Subject: Re: [xsl] Remove duplicates using preceding- or following-siblings From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Mon, 02 Apr 2012 16:28:58 +0200 |
I am working on a stylesheet to process my XML data but can't seem to resolve duplicates successfully.
Here's a simplified analogy of my XML
<library> <book id="Bk1" authorId="A1" name="Book1"/> <book id="Bk2" authorId="A2" name="Book2"/> <author id="A2" name="Auth2" /> <book id="Bk2" authorId="A2" name="Book2"/> <author id="A1" name="Auth1"/> <book id="Bk4" authorId="A1" name="Book4"/> ... </library>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="k1" match="book" use="@authorId"/> <xsl:key name="k2" match="book" use="concat(@authorId, '|', @id)"/>
<xsl:variable name="authorsList"> <xsl:apply-templates select="//author" mode="group"/> </xsl:variable>
<xsl:template match="/"> <html>
<body> <table> <tr> <td>Library Name</td> ... </tr> </table> </body> </html> </xsl:template>
<xsl:template match="book" mode="group"> <LibraryBook name="{@name}" authId="{@authorId}"/> </xsl:template>
Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Remove duplicates using p, Andrew Welch | Thread | Re: [xsl] Remove duplicates using p, Satish |
Re: [xsl] Remove duplicates using p, Andrew Welch | Date | Re: [xsl] Remove duplicates using p, David Carlisle |
Month |