带有错误的Orchestration中的XPATH问题具有无效令牌

问题描述 投票:0回答:1

我正在为XPath尝试的XML

<Life Version="2.24.0" xmlns="http://A.org/Life/2">
    <LifeResponse id="Response_001">
        <TransRefGUID>3b6418ef-0010-4f81-b67a-bd60db693e76</TransRefGUID>
        <TransResult>
            <ResultCode tc="5">Failed</ResultCode>
            <ConfirmationID />
            <RecordsFound>0</RecordsFound>

        </TransResult>
    </LifeResponse>
</Life>

我试图使用的Xpath表达式,

Result = xpath(LifeResponse,"/*[local-name()='Life' and namespace-uri()='http://A.org/Life/2']/*[local-name()='LifeResponse' and namespace-uri()='http://A.org/Life/2']/*[local-name()='TransResult' and namespace-uri()='http://A.org/Life/2']/*[local-name()='ResultCode' and namespace-uri()='http://A.org/Life/2']/@tc )");

收到错误:

Inner exception: '/*[local-name()='Life' and namespace-uri()='http://A.org/Life/2']/*[local-name()='LifeResponse' and namespace-uri()='http://A.org/Life/2']/*[local-name()='TransResult' and namespace-uri()='http://A.org/Life/2']/*[local-name()='ResultCode' and namespace-uri()='http://A.org/Life/2']/@tc )' has an invalid token

要求:

变量“Result”是一个字符串,我试图存储TC属性中的值。

问题:

当我尝试使用在线xpath测试器测试xpath时工作正常但通过BizTalk给出错误,

感谢任何帮助

xml xpath biztalk-2016
1个回答
1
投票

您是否尝试删除末尾的额外空间如下所示?

之前 - / @ tc)“);

之后 - / @ tc)“);

© www.soinside.com 2019 - 2024. All rights reserved.