Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 956795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:35:44+00:00 2026-05-16T00:35:44+00:00

I have a xsl parameter which a string. I want to parse that string,

  • 0

I have a xsl parameter which a string. I want to parse that string, split it and for each substring value I want to apply the template in the xsl.

Is this possible? If so, Can you please advise an optimistic solution?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:35:45+00:00Added an answer on May 16, 2026 at 12:35 am

    Edit: Missundertood the question, sorry.

    The answer is yes.

    Input:

    <secuence>Item1 Item2 Item3</secuence>
    

    Stylesheet:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="secuence/text()" name="secuence">
            <xsl:param name="string" select="."/>
            <xsl:param name="separator" select="' '"/>
            <xsl:if test="$string != ''">
                <xsl:choose>
                    <xsl:when test="contains($string,$separator)">
                        <xsl:call-template name="secuence">
                            <xsl:with-param name="string" select="substring-before($string,$separator)"/>
                            <xsl:with-param name="separator" select="$separator"/>
                        </xsl:call-template>
                        <xsl:call-template name="secuence">
                            <xsl:with-param name="string" select="substring-after($string,$separator)"/>
                            <xsl:with-param name="separator" select="$separator"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:otherwise>
                        <!-- Your desired template -->
                        <Item>
                            <xsl:value-of select="$string"/>
                        </Item>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>
    

    Result:

    <secuence>
        <Item>Item1</Item>
        <Item>Item2</Item>
        <Item>Item3</Item>
    </secuence>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xsl:fo style sheet that refers to a URL which is an
I have an XSL transformation where I used to query a string that way:
Let's say I have the string of 2004,2005,2006,2007,2008,2009 that is assigned to the parameter
I have some XML code that looks like this <SEARCHRESULTS> <FUNCTION name=BarGraph> <PARAMETER name=numList></PARAMETER>
I have this xml: <pos:getPositionRouter xmlns:pos=positionNS> <positionID> <code>1</code> </positionID> <parameter>?</parameter> </pos:getPositionRouter> and I want
Suppose i have a template foo which can output something given a parameter. Now
I have an XSL that is transforming one XSD into another XSD that has
I have an XSL style sheet for which I need to add some custom
I have an XSL stylesheet (A) that imports another one (B). A overrides a
I have a xsl:variable ($features-list) specified in my XSL which contains a tree fragment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.