Re: *****SPAM***** [xsl] Compare 2 XML and get Id from another XML in main XML

Subject: Re: *****SPAM***** [xsl] Compare 2 XML and get Id from another XML in main XML
From: "Christophe Marchand cmarchand@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 21 Sep 2016 14:50:39 -0000
How do you map a Name to a result ? There no common identifier in the to 
files. Or you maps the first Name with the first result, the second Name 
with the second Result, and so on ?

Which file does your XSL take as input ?

Your are not precise enough to allows us to give you a correct response.

Best,
Christophe


Le 21/09/2016 C  16:28, Rahul Singh rahulsinghindia15@xxxxxxxxx a C)crit :
> Hi,
>
> I have 2 XML. result.XML and name.xml. I am comparing both XML and 
> calling <id> from result.xml to name.xml sucess=true case.
> *
> *
> *result.xml:*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <results>
>    <result>
>         <id>001R0000018j3KBIAY</id>
>         <success>true</success>
>      </result>
>    <result>
>         <id>001R0000018j3KCIAY</id>
>         <success>true</success>
>      </result>
>    <result>
>         <id>001R0000018j3KDIAY</id>
>         <success>true</success>
>      </result>
>    <result>
>         <id>001R0000018j3KEIAY</id>
>         <success>true</success>
>      </result>
>    <result>
>         <id xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:nil="true"/>
>         <success>false</success>
>      </result>
>    <result>
>         <id>001R0000018j3KFIAY</id>
>         <success>true</success>
>      </result>
> </results>
>
> *Name.xml:*
>
>
> <Names>
>    <Name>
>       <LAST_NAME>rtt</LAST_NAME>
>       <FIRST_NAME>ds</FIRST_NAME>
>    </Name>
>    <Name>
>       <LAST_NAME>jhj</LAST_NAME>
>       <FIRST_NAME>tyt</FIRST_NAME>
>    </Name>
>    <Name>
>       <LAST_NAME>qwqw</LAST_NAME>
>       <FIRST_NAME>i</FIRST_NAME>
>    </Name>
>    <Name>
>       <LAST_NAME>trt</LAST_NAME>
>       <FIRST_NAME>ss</FIRST_NAME>
>    </Name>
>    <Name>
>       <LAST_NAME>yt</LAST_NAME>
>       <FIRST_NAME>asa</FIRST_NAME>
>    </Name>
> </Names>
>
>
> *XSLT: *
>
> <xsl:stylesheet version="2.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>     <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>
>     <xsl:strip-space elements="*"/>
>     <xsl:param name="tranFile" select="document('Name.xml')"/>
>
>     <xsl:template mode="insert" match="Names">
>         <xsl:copy-of select="../../Name"/>
>     </xsl:template>
>
>     <xsl:template match="@* | node()">
>         <xsl:copy>
>             <xsl:apply-templates select="@*"/>
>             <xsl:apply-templates mode="insert" select="."/>
>             <xsl:apply-templates mode="inserta" select="."/>
>             <xsl:apply-templates/>
>         </xsl:copy>
>     </xsl:template>
>
>     <xsl:template mode="insert" match="*"/>
>     <xsl:template mode="inserta" match="*"/>
>
>
>     <xsl:template match="@* | node()">
>         <xsl:copy>
>             <xsl:apply-templates select="@* | node()"/>
>         </xsl:copy>
>     </xsl:template>
> </xsl:stylesheet>
>
>
> *Expected Output:*
>
>
> <Names>
>    <Name>
>       <LAST_NAME>rtt</LAST_NAME>
>       <FIRST_NAME>ds</FIRST_NAME>
>  <id>001R0000018j3KBIAY</id>
>    </Name>
> ....
> ....
> </Names>
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/2837134> 
> (by email <>)

Current Thread