Subject: RE: [xsl] Grouping and sorting nodes by the values of the 2 elements, and displaying only 1 in the HTML output From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Thu, 28 Jun 2001 17:24:07 +0100 |
It's been a few days since the last grouping question on the list, so you may not have seen the standard response: See http://www.jenitennison.com/ and follow links to "grouping". Mike Kay Software AG > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of ghostrider > Sent: 28 June 2001 16:15 > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Grouping and sorting nodes by the values of the 2 > elements, and displaying only 1 in the HTML output > > > Hi everyone, > > I'm trying to process the following XML file: > > <----------XML--------------------------------> > > <root> > <Bugs> > <Bug> > <Category1>aaa</Category1> > <Category2>111</Category2> > <Description>Some text</Description> > </Bug> > <Bug> > <Category1>aaa</Category1> > <Category2>222</Category2> > <Description>Some text</Description> > </Bug> > ... > </Bugs> > </root> > > <----------XML--------------------------------> > > > > ... where Cat2 is a subcategory of Cat1. > > > What I need is to get in the output is this: > > > <----------HTML--------------------------------> > > <H1>aaa</H1> > > <H2>111<H2> > <p>Some text</p> > ... > > <H2>222<H2> > <p>Description text2</p> > ... > > <H1>bbb</H2> > > <H2>333<H2> > <p>Some text</p> > > <----------HTML--------------------------------> > > > So all Bugs should be sorted by Category1, then by Category2, > but i don't want > to output the value of Category1 for each Bug. > > The second issue is that I need to generate a linked table of > contents based > on Category1 element values: > > ------------- > Contents > aaa > bbb > ccc > -------------- > > Below is part of the XSL that I already have, and which > outputs both cat1 and > cat2 (sorted) for each Bug node. > > Someone please have a quick look at this - thanks! > > Armin > > > <----------XSL--------------------------------> > > <xsl:template match="root"> > <html> > <body> > <xsl:apply-templates select="Bugs/Bug"> > <xsl:sort select="Category1" order="ascending" /> > <xsl:sort select="Category2" order="ascending" /> > </xsl:apply-templates> > > > </body> > </html> > > > </xsl:template> > > <xsl:template match="Bug"> > > <span > > <p> > <a name="Type"><xsl:value-of select="Category1"/></a></p> > <p><xsl:value-of select="Category2"/></p></span> > > <div> > <p><xsl:value-of select="Description"/></p></div> > > </xsl:template> > > > <----------XSL--------------------------------> > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Grouping and sorting nodes by, ghostrider | Thread | [xsl] conditionally accessing attri, Yogesh |
RE: [xsl] Generating Link Reference, Rene de Vries | Date | RE: [xsl] conditionally accessing a, Michael Kay |
Month |