Hi,
I am trying to fetch the value of fifth tag(Happy) inside below sample xml but not able to do so.
This is what I have tried so far
var xmlObj = request.content.asXML;
var S = new Namespace('http://schemas.xmlsoap.org/soap/envelope/');
var l= new Namespace ('test');
var v1 = xmlObj.S::Body.l::first.I::second.toString();
var v2 = xmlObj.S::Body.l::first.I::second.I::third.toString();
I am able to get v1 but not v2. How can I ge5 the value of v2.
Can some one please help on this.
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<first xmlns="test">
<second>
<third><fourth><fifth>Happy</fifth></fourth></third>
</second>
</first>
</soap:Body>
</soap:Envelope>
third, fourth, fifth are not part of your xml schema, they're characters in the value of <second>
Thank you for inputs!
Is there any way we can retrieve the values using JS?
Maybe you could look at reencoding the characters in javascript or with the message template replace-all function https://docs.apigee.com/api-platform/reference/message-template-intro#replace-all-function