【发布时间】:2017-02-14 19:12:42
【问题描述】:
我正在尝试在 Anypoint mule 上使用 Xpath3 的 PDP 响应中获取标签 Decision。
这是 PDP 的响应:
<ns:getDecisionResponse xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://org.apache.axis2/xsd">
<ns:return><![CDATA[<Response xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:syntax-error"/><StatusMessage>Invalid request : DOM of request element can not be created from String</StatusMessage></Status></Result></Response>]]></ns:return>
</ns:getDecisionResponse>
问题是我无法访问 CDATA 中的标签。 这就是我想要做的:
#[xpath3('/ns:getDecisionResponse/ns:return/(the problem is here...)',payload, 'STRING')]
提前致谢!
胡安·安德烈斯
【问题讨论】:
-
CDATA 中没有标签。这就是 CDATA 的意思:“这里的东西可能看起来像标签,但它们不是:它们将被视为字符数据”。如果 CDATA 使用不正确,就像这里一样,那么您必须将 CDATA 的内容提取为文本,并将其提交给 XML 解析器。
标签: xpath mule cdata anypoint-studio