xsl-list
[Top] [All Lists]

Re: [xsl] Passing arrays into XSL

2006-03-06 20:43:04

Date: Sat, 25 Feb 2006 16:53:13 -0800 (PST)
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
From: Deepak <deepak_vn(_at_)yahoo(_dot_)com>
Subject: Re: [xsl] Passing arrays into XSL
Message-ID: 
<20060226005313(_dot_)24515(_dot_)qmail(_at_)web36511(_dot_)mail(_dot_)mud(_dot_)yahoo(_dot_)com>

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [xsl] Passing arrays into XSL, Alex von Thorn <=