i have writen xsl, that is working
On Wed, Sep 28, 2016 at 6:33 PM, Rahul Singh <rahulsinghindia15@xxxxxxxxx>
wrote:
> How to remove duplicate record from XML, my code is working fine, i am
> deleting duplicate, but i need only that XML which is not duplicate.
>
> *Input:*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Contact-data>
> <Contact>
> <id>074</id>
> </Contact>
> <Contact>
> <id>074</id>
> </Contact>
> * <Contact>*
> * <id>001</id>*
> * </Contact>*
> </Contact-data>
>
> *XSL:*
>
> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/
> 1999/XSL/Transform">
> <xsl:output omit-xml-declaration="yes" indent="yes"/>
> <xsl:template match="/*">
> <xsl:for-each-group select="Contact" group-by="id">
> <xsl:sequence select="."/>
> </xsl:for-each-group>
> </xsl:template>
> </xsl:stylesheet>
>
> *ExpectedOutput:*
>
> <Contact-data>
> <Contact>
> <id>001</id>
> </Contact>
> </Contact-data>
|