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 6565439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:05:40+00:00 2026-05-25T14:05:40+00:00

how to split a node value in XSLT 1.0? <mark>1,2</mark> i need to perform

  • 0

how to split a node value in XSLT 1.0?

<mark>1,2</mark>

i need to perform some operations in the for loop with each value of the output of split.

<xsl:for-each select="">
</xsl:for-each>

How to do this?

  • 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-25T14:05:41+00:00Added an answer on May 25, 2026 at 2:05 pm

    I. XSLT 1.0 solution:

    Here is one way to do this in XSLT 1.0 using only the xxx:node-set() extension function:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:ext="http://exslt.org/common" exclude-result-prefixes="ext">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
    
     <xsl:template match="mark">
      <xsl:variable name="vrtfSplit">
       <xsl:apply-templates/>
      </xsl:variable>
    
      <xsl:for-each select="ext:node-set($vrtfSplit)/*">
       <processedItem>
        <xsl:value-of select="10 * ."/>
       </processedItem>
      </xsl:for-each>
     </xsl:template>
    
     <xsl:template match="text()" name="split">
      <xsl:param name="pText" select="."/>
       <xsl:if test="string-length($pText) >0">
        <item>
         <xsl:value-of select=
          "substring-before(concat($pText, ','), ',')"/>
        </item>
    
        <xsl:call-template name="split">
         <xsl:with-param name="pText" select=
         "substring-after($pText, ',')"/>
        </xsl:call-template>
       </xsl:if>
     </xsl:template>
    </xsl:stylesheet>
    

    when this transformation is applied to the following XML document:

    <mark>1,2,3,4,5</mark>
    

    The wanted, correct output (each item multiplied by 10) is produced:

    <processedItem>10</processedItem>
    <processedItem>20</processedItem>
    <processedItem>30</processedItem>
    <processedItem>40</processedItem>
    <processedItem>50</processedItem>
    

    II. XSLT 2.0 solution:

    <xsl:stylesheet version="2.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
      exclude-result-prefixes="xs">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
    
     <xsl:template match="mark">
      <xsl:for-each select="tokenize(., ',')">
       <processedItem>
        <xsl:sequence select="10*xs:integer(.)"/>
       </processedItem>
      </xsl:for-each>
     </xsl:template>
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add CSS classes to each item output by an XSLT template.
I need to split the following XML file based on a predetermined value, for
Is there some kind of split() function in XPath? Say I have this XML:
I'm using the split linux command to split huge xml files into node-sized ones.
I have my sources split up in several directories, so for each directory I
Let's say there is a graph and some set of functions like: create-node ::
How do i select the preceding nodes of a text node starting from a
I have an object, and I have a new value which I need to
I need to split data evenly across n nodes in a distributed cache. The
var nodeWordsString = document.getElementById(nodeWordsTextArea).value.trim(); var nodeWordsStringArray=nodeWordsString.split( ); var strLength = nodeWordsStringArray.length; for(int i =

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.