[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Putting a nodeset in a variable
Hello Ismael,
the template <xsl:template match="/"> <xsl:for-each select="traps/trap"> <xsl:sort select="./@id"/> <xsl:value-of select="@id"/> </xsl:for-each> </xsl:template> does the same like your one. But you called your variable distinctValues, so I assume you *want* distinct values. Then it is a grouping problem and the most propagated method is the Muenchian one: <xsl:key name="traps" match="trap" use="@id"/> <xsl:template match="/traps"> <xsl:for-each select="trap[generate-id() = generate-id(key('traps', @id))]"> <xsl:sort select="@id"/> <xsl:value-of select="@id"/> </xsl:for-each> </xsl:template> And the most propagated web resource relating to Muenchian Method is http://www.jenitennison.com/xslt/grouping/muenchian.xml. Regards, Joerg Cams Ismael wrote: Hello, XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|