根据标签值从肥皂响应中提取值

发布于 2025-01-23 14:30:20 字数 1681 浏览 1 评论 0原文

我的肥皂响应如下:

<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:fn35="http://www.filenet.com/ns/fnce/2005/02/ws/schema" xmlns:fn40m="http://www.filenet.com/ns/fnce/2006/11/ws/MTOM/schema" 
xmlns:fn40="http://www.filenet.com/ns/fnce/2006/11/ws/schema" xmlns:xop="http://www.w3.org/2004/08/xop/include" 
xmlns:e="http://www.w3.org/2003/05/soap-envelope">
    <e:Body>
        <ExecuteChangesResponse xmlns="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
            <ChangeResponse id="1" classId="Document" objectId="{F4CA442A-CE20-45E8-8372-7F34367113A4}" 
            objectStore="{2417ADC1-633A-4DE3-ADC1-7B6E85E832A9}" 
            updateSequenceNumber="0" accessAllowed="998903">
                <Property i:type="fn40:SingletonString" propertyId="Owner" settable="1">
                    <Value>testUser</Value>
                </Property>
                <Property i:type="fn40:SingletonId" propertyId="Id">
                    <Value>{F4CA442A-CE20-45E8-8372-7F34367113A4}</Value>
                </Property>             
            </ChangeResponse>
        </ExecuteChangesResponse>
    </e:Body>
</e:Envelope>

我想提取具有PropertyID =“ ID”的属性的值 所以我尝试了以下内容,然后返回一个空字符串

<property expression="//ExecuteChangesResponse/ChangeResponse/property[@propertyId='Id']/text()" name="Id" scope="default" 
                    type="STRING"  
                    xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />

My soap response is as follows :

<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:fn35="http://www.filenet.com/ns/fnce/2005/02/ws/schema" xmlns:fn40m="http://www.filenet.com/ns/fnce/2006/11/ws/MTOM/schema" 
xmlns:fn40="http://www.filenet.com/ns/fnce/2006/11/ws/schema" xmlns:xop="http://www.w3.org/2004/08/xop/include" 
xmlns:e="http://www.w3.org/2003/05/soap-envelope">
    <e:Body>
        <ExecuteChangesResponse xmlns="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
            <ChangeResponse id="1" classId="Document" objectId="{F4CA442A-CE20-45E8-8372-7F34367113A4}" 
            objectStore="{2417ADC1-633A-4DE3-ADC1-7B6E85E832A9}" 
            updateSequenceNumber="0" accessAllowed="998903">
                <Property i:type="fn40:SingletonString" propertyId="Owner" settable="1">
                    <Value>testUser</Value>
                </Property>
                <Property i:type="fn40:SingletonId" propertyId="Id">
                    <Value>{F4CA442A-CE20-45E8-8372-7F34367113A4}</Value>
                </Property>             
            </ChangeResponse>
        </ExecuteChangesResponse>
    </e:Body>
</e:Envelope>

and I want to extract the value of the property that has propertyId="Id"
so I tried the following and it returns an empty string

<property expression="//ExecuteChangesResponse/ChangeResponse/property[@propertyId='Id']/text()" name="Id" scope="default" 
                    type="STRING"  
                    xmlns:i="http://www.w3.org/2001/XMLSchema-instance" />

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏日浅笑〃 2025-01-30 14:30:20

我能够提取以下值:

<property expression="$body/fn:ExecuteChangesResponse/fn:ChangeResponse/fn:Property[@propertyId='Id']/fn:Value" name="Id" scope="default" 
 type="STRING"  
 xmlns:fn="http://www.filenet.com/ns/fnce/2006/11/ws/schema" />

I was able to extract the value as follows :

<property expression="$body/fn:ExecuteChangesResponse/fn:ChangeResponse/fn:Property[@propertyId='Id']/fn:Value" name="Id" scope="default" 
 type="STRING"  
 xmlns:fn="http://www.filenet.com/ns/fnce/2006/11/ws/schema" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文