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

[xsl] tokenize, looping, assigning variable and conditional statement


Subject: [xsl] tokenize, looping, assigning variable and conditional statement
From: Deepak <deepak_vn@xxxxxxxxx>
Date: Sat, 25 Feb 2006 18:30:49 -0800 (PST)

Hi All,

Am trying to match the multiple strings in the
parameter list with node values. Am wondering why its
not working or is th'r any alternative solution  this?

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

  <xsl:output method="text"/>

  <xsl:template match="/">
  <xsl:param name="sampleString">color[1],color[2] 
</xsl:variable>

 <xsl:variable name="tokenizedSample"
select="tokenize($sampleString,',')"/>

    <xsl:for-each select="$tokenizedSample">
        <xsl:variable name="test" select="."/>
        <xsl:if test="contains(color,$test)">
          <xsl:text> process something</xsl:text>
        </xsl:if>
    </xsl:for-each>


  </xsl:template>

</xsl:stylesheet>

Thanks and Regards,
Deepak

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Current Thread