[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Split and Found unique values
In XSLT1 it works good. It is joining all values but I have problems now with split and find unique values. This is my function. $seen variable should contain all processed values to find unique: <xsl:template name="Split"> <xsl:param name="strInput"/> <xsl:param name="strDelimiter" select="'-'"/> <xsl:param name="processed"/> <xsl:variable name="strNextItem" select="substring-before($strInput,$strDelimiter)"/> <xsl:variable name="strOutput" select="substring-after($strInput,$strDelimiter)"/> <xsl:variable name="seen" select="concat($strNextItem,'-',$processed)"/> <xsl:choose> <xsl:when test='contains($strInput,$strDelimiter) and (not(contains($strNextItem,$seen)))'> <xsl:element name='OPTION'> <xsl:value-of select="$strNextItem"/> </xsl:element> <xsl:call-template name="Split"> <xsl:with-param name="strInput" select="$strOutput"/> <xsl:with-param name="strDelimiter" select="$strDelimiter"/> <xsl:with-param name="processed" select="$seen"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:if test="not(contains($strInput,$seen))"> <xsl:element name='OPTION'> <xsl:value-of select="$strInput"/> </xsl:element> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template> ---------- Initial Header -----------
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|