[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] grouping content
Hi, Gavinm Following is provided based two level grouping method for your group problem. Test using ie5 and msxml3. <?xml version="1.0" encoding="big5" ?> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" /> <xsl:key name="Area" match="Location" use="@Area" /> <xsl:key name="Value" match="Location" use="concat(@Area,' ',@Value)" /> <xsl:variable name="source" select="/docs/Location" /> - <xsl:template match="/"> - <xsl:apply-templates select="//Location[generate-id(.)=generate-id(key('Area',@Area)[1])]" mode="first"> <xsl:sort select="@Area" /> </xsl:apply-templates> </xsl:template> - <xsl:template match="Location" mode="first"> <br /> Location <xsl:value-of select="@Area" /> <br /> - <xsl:apply-templates select="key('Area',@Area)[generate-id(.) =generate-id(key('Value',concat(@Area,' ',@Value))[1])]" mode="second"> <xsl:sort select="@Value" /> </xsl:apply-templates> </xsl:template> - <xsl:template match="Location" mode="second"> <xsl:value-of select="key('Value',concat(@Area,' ',@Value))/@Value" /> <br /> </xsl:template> </xsl:stylesheet> hope it will help, Sun-fu Yang sfyang@xxxxxxxxxxxxx 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
|