#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Iterating a comma separated list in xsl


    Hi all,

    I am new to xsl and just trying to iterate a comma separated list in xsl.

    I will retrieve a comma separated string from a java method in side xsl and want to split it. After splitting i want to compare each element in the comma separated string with another value.

    Can any one suggest how to achieve this?

    Thank You,
    --Rakesh
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,119
    Rep Power
    9398
    I'm thinking your best bet would be to split the string in Java and give the XSLT processor a nodelist of text nodes. Then you can xsl:for-each on it and whatnot.

    Otherwise: I don't know if Java (and if so, starting at which version) can do XPath 2 functions. You'd need those to do string parsing.

IMN logo majestic logo threadwatch logo seochat tools logo