on 02-20-2013 6:17 PM
Hi,
I am getting the response with soap.envelope and trying to remove this one, if there is attribute my xsl:copy of statement is not working. Please help.
while trying to use the copy-of select following attribute it's giving me error - <id xsi:nil="true"/>
I wanted to use only xslt mapping not any other mappings...
xslt code:
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="SOAP-ENV:Body">
<xsl:copy-of select="child::node()"/>
</xsl:template>
</xsl:stylesheet>
source xml :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<updateResponse>
<result>
<errors>
<fields>Id</fields>
<message>Account ID: id value of incorrect type: 001d0VelZ</message>
<statusCode>MALFORMED_ID</statusCode>
</errors>
<id xsi:nil="true"/>
<success>false</success>
</result>
</updateResponse>
</soapenv:Body>
</soapenv:Envelope>
Regards,
Venu.
Hi Venu,
Please try this:
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="SOAP-ENV:Body">
<xsl:copy-of select="node()"/>
</xsl:template>
</xsl:stylesheet>
Copy-of copies all child elements and attributes so there is no need of child::.
Also will you please share your both source and target xmls?
Regards,
Beena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below attribute is not copying...
<id xsi:nil="true"/>
my source xml :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<updateResponse>
<result>
<errors>
<fields>Id</fields>
<message>Account ID: id value of incorrect type: 0010VelZ</message>
<statusCode>MALFORMED_ID</statusCode>
</errors>
<id xsi:nil="true"/>
<success>false</success>
</result>
</updateResponse>
</soapenv:Body>
</soapenv:Envelope>
and target xml, I wanted to get from <updateResponse> </updateResponse>
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.