Reputation: 9692
I have the following XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://ws.apache.org/axis2">
<soapenv:Header/>
<soapenv:Body>
<axis:ErrorQueueInput>
<errorStr>JIRA Topic</errorStr>
<InputMessage> <a>jira message</a><b>jira2 msg</b> </InputMessage>
</axis:ErrorQueueInput>
</soapenv:Body>
</soapenv:Envelope>
where I need to get the output as:
<a>jira message</a><b>jira2 msg</b>
If I keep my XPath like;
//soapenv1:Envelope/soapenv1:Body/axis:ErrorQueueInput/InputMessage
output is something like:
jira message jira2 msg
If I try like this:
//soapenv1:Envelope/soapenv1:Body/axis:ErrorQueueInput/InputMessage//child::*
output is (which is wrong):
jira message
How can I get whole XML (i.e.: <a>jira message</a><b>jira2 msg</b>
) as my output?
Upvotes: 1
Views: 66
Reputation: 31621
Whatever you are using to evaluate the xpath is coercing the node value to a string. Since you don't say what you are currently doing, we can't tell you what is wrong.
On the off chance you are using XSL, possibly you are using value-of
when you should be using copy-of
.
Upvotes: 2