【发布时间】:2013-05-03 18:08:44
【问题描述】:
当属性 xmlns="..." 并且它是父元素时,我很难查询数据元素值的值。 以下示例是 SOAP 响应的一部分,我想通过使用 XPATH /PartyInq_v2Response/PartyInq_v2Rs_Type/*[local-name()="person"]/firstName 获取它的名字和姓氏的值' 。但它什么也没返回。如果我全部删除它可以返回值 xmlns="..." 来自查询前的 xml。有人知道如何直接从示例中查询名字吗?
<PartyInq_v2Response xmlns="urn:Somewhere.Int" xmlns:q2="http://SomewhereOps.v20120719" xmlns:q10="http://SomewhereTypes.v20120719.GenericTypes">
<PartyInq_v2Rs_Type>
<q2:person>
<firstName xmlns="http://SomewhereTypes.v20120719.Types">somebody</firstName>
<lastName xmlns="http://SomewhereTypes.v20120719.Types">nobody</lastName>
</q2:person>
</PartyInq_v2Rs_Type>
</PartyInq_v2Response>
谢谢
卢
【问题讨论】:
标签: xml xslt xpath xml-namespaces