Subject: [xsl] Only first rows (after the sort) From: "Stinissen, Dennis" <D.Stinissen@xxxxxxxxx> Date: Tue, 15 Aug 2006 16:22:38 +0200 |
Hi, I have a problem transforming an XML file to the desired table structure. I hope someone can help me. Here is the XML file I use: <example> <category>XML</category> <year>2005</year> </example> <example> <category>XSL</category> <year>2005</year> </example> <example> <category>XSL</category> <year>2006</year> </example> <example> <category>XML</category> <year>2005</year> </example> ... Here is how the table should look eventually: Catagory Year XML 2005 XSL 2005 XSL 2006 ... My current XSL: <xsl:for-each select="example"> <xsl:sort select="category"><xsl:sort select="year"> <tr><td><xsl:value-of select="./category"></td><td><xsl:value-of select="./year"></td></tr> </xsl:for-each> This results in: Catagory Year XML 2005 XML 2005 XSL 2005 XSL 2006 ... So what I'm trying to do is to skip rows when the combination of category and year are identical (skip the duplicates). I've tried to put it in an <xsl:if> combined with <xsl:variable> construction, but I just can't get it right. Does anyone have an idea? Kind regards, Dennis
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Dividing a long document , Choi Ryan | Thread | Re: [xsl] Only first rows (after th, Wendell Piez |
Re: [xsl] error/confusion with tran, Wendell Piez | Date | RE: [xsl] Selecting the first node , Wendell Piez |
Month |