[Home] [By Thread] [By Date] [Recent Entries]
Hello,
I am wondering what's the best way of getting rid of duplicate nodes which contain more than one attribute. Suppose I have den following xml:
How do I get rid of one <edge source="IGetter" target="CGetter" dependency="positive"/> and one <edge source="ICount" target="CCount" dependency="positive"/> which appear twice? If there was only one attribute, lets say "source" it would be simple: <xsl:for-each select="//edge[not(./@source=preceding-sibling::edge/@source)]"> <xsl:copy-of select="."/> </xsl:for-each> So I thought with more attributes this would work: <xsl:for-each select="//edge[not(./@source=preceding-sibling::edge/@source and ./@target=preceding-sibling::edge/@target and ./@dependency=preceding-sibling::edge/@dependency )]"> </xsl:for-each> But of course it doesen't because in one iterartion the "preceding-siblings" doesn't point to the same element. So, any help would be appreciated on how to get rid of duplicates. Regards, Garvin
|

Cart



