[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: help on removing duplicates
Hi jvalentin,
try this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:key name="duplicateEl" match="el" use="node" /> <xsl:key name="duplicateNode" match="rel/el/node" use="concat(parent::el/parent::rel/parent::el/node,'::',.)" /> <xsl:template match = "/"> <xsl:for-each select="xml/el[count(. | key('duplicateEl', node)[1]) = 1]"> <xsl:sort select="node" /> <xsl:variable name="node" select="node"/> <xsl:value-of select="node"/><xsl:text>-</xsl:text> <xsl:for-each select="//rel[parent::el/node=$node]/el/node[count(. | key('duplicateNode', concat(parent::el/parent::rel/parent::el/node,'::',.))[1]) = 1]"> <xsl:sort select="." /> <xsl:value-of select="."/> </xsl:for-each> <xsl:text>$</xsl:text> </xsl:for-each> </xsl:template> </xsl:stylesheet> I get: linebreaks with $ A-XY B-XZ C-Z ... Cheers, Juergen
|
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
|