1

I have a soap message that has to be inserted into a JSON message to be sent to the backend. But the double quotes within xml namespace atributes in the soap message have to be escaped in order to achieve this. The are several solutions to modify the text nodes (xslt 1.0 string replace function). How can the solution be modified to apply to the attributes of all nodes within the message.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ab:xyz xmlns:ab=".....">
          ........
      </ab:xyz>
   </soap:Body>
</soap:Envelope>

Has to be changed to-

<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
   <soap:Body>
      <ab:xyz xmlns:ab=\".....\">
          ........
      </ab:xyz>
   </soap:Body>
</soap:Envelope>

Thanks!

Community
  • 1
  • 1
vikram
  • 11
  • 2
  • You must pass the XML you want to be escaped as a string. Then you can do any substring replacement with the methods that are already available to you. – Dimitre Novatchev Jul 31 '16 at 05:01
  • Thanks for the reply. I was able implementing this on datapower using the serialize function on input and using it on the the template referenced above – vikram Aug 02 '16 at 13:48

0 Answers0