[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Passing arrays into XSL


Subject: Re: [xsl] Passing arrays into XSL
From: Alex von Thorn <avt@xxxxxxxxxxxxxx>
Date: Wed, 01 Mar 2006 01:31:20 -0500

Date: Sat, 25 Feb 2006 16:53:13 -0800 (PST)
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
From: Deepak <deepak_vn@xxxxxxxxx>
Subject: Re: [xsl] Passing arrays into XSL
Message-ID: <20060226005313.24515.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

Hi Jern,

Thanks for your help.

But my need is bit different, we have to match with
the strings from the variable or the parameter from a
servlet response.

  So i need to match those strings available in the
'param' with actual xml file. The xml file nodes may
be more than blue,red colors.  So the XSL display
should be depends on the values available in the
param. The parameter string may be with a delimiter
','(red, blue) or '' (red blue).

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="arrayString">
   blue,red
</xsl:param>


There are ways you can do this, you just need to think like XML. For example:

in the XML file


<colors> <color index="1">red</color> <color index="2">blue</color> <color index="3">green</color> ... </colors>


and then your XSL might look like


<xsl:param name="colorArray">
   <colorArray>
      <color>blue</color>
      <color>red</color>
   </colorArray>
</xsl:param>
<!-- code follows -->



Alex von Thorn
http://worldhouse.com/alex/

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin


Current Thread
Keywords