Hi Experts,
Can you please help me with the XSLT code to replace the below xml to the one I need. There are three prefixes ns0,ns1 and ns2 which are to be replaced with tem,ep4 and ep41.
Input Structure
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://tempuri.org/" xmlns:ns1="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities.Common" xmlns:ns2="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities">
<soapenv:Header />
<soapenv:Body>
<ns0:PrintCertificateByContractNumber>
<ns0:ContractNumber>300004</ns0:ContractNumber>
<ns0:Credentials>
<ns1:Password>a2fP2te254b0d0d74bDe</ns1:Password>
<ns1:ResponseStatusList>
<ns2:ResponseStatus>
<ns2:ErrorMessage />
<ns2:ResponseType>Error</ns2:ResponseType>
</ns2:ResponseStatus>
</ns1:ResponseStatusList>
<ns1:UserName>e.eppcointegration</ns1:UserName>
<ns1:UserReferenceNumber />
</ns0:Credentials>
</ns0:PrintCertificateByContractNumber>
</soapenv:Body>
</soapenv:Envelope>
Output Structure
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ep4="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities.Common" xmlns:ep41="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities" xmlns:tem="http://tempuri.org/">
<soapenv:Header />
<soapenv:Body>
<tem:PrintCertificateByContractNumber>
<tem:ContractNumber>300001</tem:ContractNumber>
<tem:Credentials>
<ep4:Password>a2fP2te254b0d0d74bDe</ep4:Password>
<ep4:ResponseStatusList>
<ep41:ResponseStatus>
<ep41:ErrorMessage />
<ep41:ResponseType>Error</ep41:ResponseType>
</ep41:ResponseStatus>
</ep4:ResponseStatusList>
<ep4:UserName>e.eppcointegration</ep4:UserName>
<ep4:UserReferenceNumber>1234567890</ep4:UserReferenceNumber>
</tem:Credentials>
</tem:PrintCertificateByContractNumber>
</soapenv:Body>
</soapenv:Envelope>
Request clarification before answering.
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://tempuri.org/" xmlns:ns1="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities.Common" xmlns:ns2="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities">
<xsl:template match="/">
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ep4="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities.Common" xmlns:ep41="http://schemas.datacontract.org/2004/07/EP4.Integration.Entities" xmlns:tem="http://tempuri.org/">
<soapenv:Body>
<tem:PrintCertificateByContractNumber>
<tem:ContractNumber>
<xsl:value-of select="soapenv:Envelope/soapenv:Body/ns0:PrintCertificateByContractNumber/ns0:ContractNumber"/>
</tem:ContractNumber>
<tem:Credentials>
<ep4:Password>
<xsl:value-of select="soapenv:Envelope/soapenv:Body/ns0:PrintCertificateByContractNumber/ns0:Credentials/ns1:Password"/>
</ep4:Password>
<ep4:ResponseStatusList>
<ep41:ResponseStatus>
<ep41:ErrorMessage>
<xsl:value-of select="soapenv:Envelope/soapenv:Body/ns0:PrintCertificateByContractNumber/ns0:Credentials/ns1:ResponseStatusList/ns2:ResponseStatus/ns2:ErrorMessage"/>
</ep41:ErrorMessage>
<ep41:ResponseType>
<xsl:value-of select="soapenv:Envelope/soapenv:Body/ns0:PrintCertificateByContractNumber/ns0:Credentials/ns1:ResponseStatusList/ns2:ResponseStatus/ns2:ResponseType"/>
</ep41:ResponseType>
</ep41:ResponseStatus>
</ep4:ResponseStatusList>
<ep4:UserName>
<xsl:value-of select="soapenv:Envelope/soapenv:Body/ns0:PrintCertificateByContractNumber/ns0:Credentials/ns1:UserName"/>
</ep4:UserName>
<ep4:UserReferenceNumber>
<xsl:value-of select="soapenv:Envelope/soapenv:Body/ns0:PrintCertificateByContractNumber/ns0:Credentials/ns1:UserReferenceNumber"/>
</ep4:UserReferenceNumber>
</tem:Credentials>
</tem:PrintCertificateByContractNumber>
</soapenv:Body>
</soapenv:Envelope>
</xsl:template>
</xsl:stylesheet>
ask me , similarly type of requirements to provide solutions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.