Re: [xsl] Tokenize comma separated string in XSL

Subject: Re: [xsl] Tokenize comma separated string in XSL
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 21 Mar 2007 12:52:08 +0100
Lalit.Chanchlani@xxxxxxxxxxxxxxxxxx wrote:
I am using XSLT 1.0 In the XSL I get the comma separated string
ABC,DEF,GHI as a parameter which is set by a Java program.


The output XML should be:

<AllCodes>
   <Code value = "A">
      <Description="ABC"/>

<snip />

This is almost a 100% copy of your original post, without any changes to your output XML (which still is *not* XML!). D-R-Y, it is not needed, we all read your previous posts.


Did you read my original reply? I suggested for XSLT 1 that you go for any of the many string-tokenize methods, like recursive applying a named template with substring-before/after etc. There are many suggestions in the FAQ. A general solution is here: http://www.exslt.org/str/functions/tokenize/index.html (go to XSLT Template link).

Current Thread