【发布时间】:2019-01-31 09:33:40
【问题描述】:
我无法使用下面的 xpath 访问属性标记下的 PartNumber/Description 值,但下面给出了soap xml。让我知道需要的更多详细信息。
请对此提供帮助。谢谢!
正在使用 Xpath 和 SOAP XML 消息:
<xsl:value-of select="/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='PullCustomerPartsPricingResponse']/*[local-name()='PullCustomerPartsPricingResult']/*[local-name()='CustomerPart']/@*[local-name()='PartNumber']"/>
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header />
<s:Body>
<PullCustomerPartsPricingResponse xmlns="http://cdx.dealerbuilt.com/Api/0.99/">
<PullCustomerPartsPricingResult xmlns:a="http://schemas.datacontract.org/2004/07/DealerBuilt.BaseApi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CustomerPart>
<a:Placement>
<a:GroupId>10</a:GroupId>
</a:Placement>
<a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/DealerBuilt.Models.Parts">
<b:AddedDate>2017-12-19T00:00:00</b:AddedDate>
<b:DealerPartId>287925</b:DealerPartId>
<b:Description>BAT (51/500AMP85)</b:Description>
<b:PartNumber>31500SB2yy1M</b:PartNumber>
<b:QuantityLostMonthToDate>0</b:QuantityLostMonthToDate>
</a:Attributes>
<a:PartKey>GZ287925</a:PartKey>
<a:CustomerListPrice xmlns:b="http://schemas.datacontract.org/2004/07/DealerBuilt.Models">
<b:Amount>130.49</b:Amount>
<b:Currency>UsDollar</b:Currency>
</a:CustomerListPrice>
</a:CustomerPart>
</PullCustomerPartsPricingResult>
</PullCustomerPartsPricingResponse>
</s:Body>
</s:Envelope>
问候 瓦尔丹
【问题讨论】:
-
命名空间将被使用,而不是避免。看; stackoverflow.com/questions/34758492/…
标签: xslt xpath ibm-datapower