[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSL matching and duplication!

Subject: XSL matching and duplication!
From: "Rahul Singh rahulsinghindia15@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 31 Aug 2017 03:27:45 -0000
 XSL matching and duplication!
Hi,

i need data from input1.xml check first if clientname/id is matching with
clientdata/name from input2.xml otherwise delete duplication based on
clientname/Email from input1.xml, My duplication is working but i am not
geetitng first condition data:

<xsl:stylesheet version="2.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:key name="kBymail" match="clientname" use="Email"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="clientname[Email =
following-sibling::clientname/Email]"/>
</xsl:stylesheet>

Input1.xml:
------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ClientInfo>
   <clientname>
        <Id>003f40000049yJYAAY</Id>
        <Email>gbc@xxxxxxxxx</Email>
     </clientname>
   <clientname>
        <Id>003f40000049z3iAAA</Id>
        <Email>gbc@xxxxxxxxx</Email>
     </clientname>
   <clientname>
        <Id>003f40000049z3nAAA</Id>
        <Email>gbc@xxxxxxxxx</Email>
     </clientname>
   <clientname>
        <Id>003f40000048uLLAAY</Id>
        <Email>gar@xxxxxxxxx</Email>
     </clientname>
   <clientname>
        <Id>003f40000049t38AAA</Id>
        <Email>gad@xxxxxxxxx</Email>
     </clientname>
  </objects>

Input2.xml:
---------------------------------------
  <?xml version="1.0" encoding="UTF-8"?>
<ClientInfo>
   <clientdata>
        <name>003f40000048uLLAAY</name>
      <clientnameReference>
           <Email>gar@xxxxxxxxx</Email>
        </clientnameReference>
     </clientdata>
   <clientdata>
        <name>003f40000049t38AAA</name>
      <clientnameReference>
           <Email>gad@xxxxxxxxx</Email>
        </clientnameReference>
     </clientdata>
   <clientdata>
        <name>003f40000049yJYAAY</name>
      <clientnameReference>
           <Email>gbc@xxxxxxxxx</Email>
        </clientnameReference>
     </clientdata>
  </objects>


Expectedoutput:
---------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ClientInfo>
   <clientname>
        <Id>003f40000049yJYAAY</Id>
        <Name>barcode11</Name>
        <Email>gbc@xxxxxxxxx</Email>
     </clientname>
   <clientname>
        <Id>003f40000048uLLAAY</Id>
        <Name>Bob Robben</Name>
        <Email>gar@xxxxxxxxx</Email>
     </clientname>
   <clientname>
        <Id>003f40000049t38AAA</Id>
        <Name>ADVT4</Name>
        <Email>gad@xxxxxxxxx</Email>
     </clientname>
  </objects>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.