[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

passing coma separated values as params

Subject: passing coma separated values as params
From: "Jan Limpens" <jan@xxxxxxxxxxx>
Date: Thu, 23 Nov 2006 22:05:30 -0200
coma separated
Hello,

I need to output something like this:

<foo>
  <bar language="en" />
  <bar language="de" />
  <bar language="pt" />
</foo>

and it would be best if could pass the stylesheet a param like this:
<xsl:param name="languages" select="'de,en,pt'"/>
then I would somehow split this string into an array of strings or a
nodeset and I would iterate over this in a way similar to this...

<xsl:template match="/">
  <foo>
  <xsl:for-each select="$language-array/*">
     <bar>
        <xsl:attribute name="language">
           <xsl:value-of select="."/>
        </xsl:attribute>
     </bar>
  </xsl:for-each>
  </foo>
</xsl:match:template>

Anyone with an idea how I could achieve this?

I know, I could pass a nodeset to begin with, but that would
complexity just elsewhere and I don't have an idea how one could debug
such a stylesheet.

Everything .NET xslt 1.0.

Thanks a lot!!!

--
Jan
www.limpens.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.