我有以下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>在这里,我需要获得如下输出:
<a>jira message</a><b>jira2 msg</b>如果我像这样保持我的XPath;
//soapenv1:Envelope/soapenv1:Body/axis:ErrorQueueInput/InputMessage输出类似于:
jira message jira2 msg如果我这样尝试:
//soapenv1:Envelope/soapenv1:Body/axis:ErrorQueueInput/InputMessage//child::*输出为(这是错误的):
jira message如何获得整个XML (即:<a>jira message</a><b>jira2 msg</b>)作为我的输出?
发布于 2011-12-12 13:22:34
无论您用来计算xpath的是什么,都是将节点值强制转换为字符串。由于您没有说明您当前正在做什么,因此我们无法告诉您哪里出了问题。
在您使用XSL的可能性很小的情况下,当您应该使用copy-of时,您可能正在使用value-of。
https://stackoverflow.com/questions/8470106
复制相似问题