|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Removing duplicate elements a-priori?
Mike,
I'm trying to remove duplicate tags in the xml output. That is, if the input xml file is : <doc>
<A/>
<A/>
</doc>The output should be: <doc>
<A/>
</doc>Also, I don't want to have to know there is a tag named "doc" or "A" in the input document. It would be fine if the output duplicates were only removed at the level of the children of the root. I tried this, and it doesn't produce any output: <xsl:key name="namekey" match="*" use="concat(generate-id(..), '/', name())"/> <xsl:template match="*"> <xsl:apply-templates select="*[generate-id()=generate-id(key('namekey', concat(generate-id(..), '/', name ())))]"/> </xsl:template> I also tried <xsl:key name="namekey" match="doc/*" use="concat(generate-id(..), '/', name())"/> <xsl:template match="doc"> <xsl:apply-templates select="*[generate-id()=generate-id(key('namekey', concat(generate-id(..), '/', name ())))]"/> </xsl:template> which also didn't work. Any help would be most appreciated... Thanks, Gordon At 10:28 AM 6/19/00 +0100, you wrote: You haven't defined your requirement very clearly, but let's guess that your requirement is to copy the first instance of each child element type of the <doc> element. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








