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

Merging is not working by xsl for 2 xml

Subject: Merging is not working by xsl for 2 xml
From: "Rahul Singh rahulsinghindia15@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 11 Jun 2017 11:46:35 -0000
 Merging is not working by xsl for 2 xml
Hi,

I tried to merge 2 xml based if /objects/phone/ContactId from merge1.xml
equal to /objects/Contact/Id from merge2.xml with below xsl, both xml are
attached:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:p0="urn:sobject.partner.soap.sforce.com" xmlns:xsi="
http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:param name="with" select="document('merge2.xml')"/>
<xsl:template match="p0:objects">
<xsl:for-each select="p0:phone">
<xsl:if test="p0:Phone_Type='Document Uploaded' or p0:Phone_Type='Document
Viewed'">
<xsl:variable name="aaa" select="p0:ContactId"/>
<!--<xsl:if test="exists($aaa=$with/objects/Contact/Id)">-->
<xsl:copy>
<xsl:apply-templates/>
<xsl:copy-of select="$with"/>
</xsl:copy>
<!--</xsl:if>-->
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

[demime 1.01d removed an attachment of type text/xml which had a name of merge1.xml]

[demime 1.01d removed an attachment of type text/xml which had a name of merge2.xml]

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.