xsl-list
[Top] [All Lists]

tokenize, looping, assigning variable and conditional statement

2006-02-25 19:30:49
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 

--~------------------------------------------------------------------
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>