Thursday, 22 August 2013

Retrieve escaped XML and unescape using XSLT 1.0

Retrieve escaped XML and unescape using XSLT 1.0

I am calling a web service that embeds the response XML as escaped XML.
I'm receiving the complete SOAP response, but am only interested in the
'escaped XML' portion ().
I'm trying to write a XSL (1.0) to retrieve that escaped XML and UNESCAPE
it, so I can process it via other non-XSLT components.
I have tried some of the other solutions for 'unescaping' in
StackOverflow, but with no luck.
Response from Web Service
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<SendMessageResponse xmlns="http://www.company.com/CAIS">
<SendMessageResult>&lt;?xml
version="1.0"?&gt;&lt;IEXInboundServiceResponse&gt;&lt;IEXInboundServiceResponseVersion&gt;1.0&lt;/IEXInboundServiceResponseVersion&gt;&lt;ServiceResponse&gt;IEX_SUCCESS&lt;/ServiceResponse&gt;&lt;RequestMessageId&gt;22658651-024E-445B-96C1-94F027205E01&lt;/RequestMessageId&gt;&lt;/IEXInboundServiceResponse&gt;</SendMessageResult>
</SendMessageResponse>
</s:Body>
</s:Envelope>
Desired output after unescaping
<?xml version="1.0"?>
<IEXInboundServiceResponse>
<IEXInboundServiceResponseVersion>1.0</IEXInboundServiceResponseVersion>
<ServiceResponse>IEX_SUCCESS</ServiceResponse>
<RequestMessageId>22658651-024E-445B-96C1-94F027205E01</RequestMessageId>
</IEXInboundServiceResponse>
Help!
Thanks
David

No comments:

Post a Comment