|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: To eliminate duplicate entries
XML:
<example>
<employee name="111"/>
<employee name="222"/>
<employee name="111"/>
</example>
XSLT 1.0:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
<xsl:key name="employee" use="@name" match="/*/employee"/>
<xsl:template match="/">
<result>
<xsl:copy-of
select="*/employee[count(key('employee', @name)[1]|.)=1]"/>
</result>
</xsl:template>
</xsl:stylesheet>
Te idea behind the code: Use grouping and select the first occurance.
tomi
-----Original Message-----
From: X.P.Pratibha :-) [mailto:xp_pratibha@xxxxxxxxxx]
Sent: Wednesday, June 08, 2005 11:23 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: To eliminate duplicate entries
Hi all.,
I am novoice to XSL .
My XML has multiple Duplicate entries and while displaying it through
XSL I have to eliminate the multiple duplicate entries and display only
one entry .
Is there is any way to check the uniqueness of the data to be displayed
in XSL.
In my xml data say if "employee id" is unqui ,Is there anyway to check
the replication of employee id in xsl.
Any links or sample code will be of great help.
Thanks,
Pratibha
This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender immediately and delete the original. Any
other use of the email by you is prohibited.
|
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








