0

I'm trying to set properties and confused as to what the xpath would be. For example, one of my properties is

props['SuperiorOrganization'] = parts[0].xpath('/rs:Report_Entry/rs:SuperiorOrganization/Descriptor') 

and I tried using rs:/descriptor with no value.

My xml is returning something like this:

<wd:SuperiorOrganization wd:Descriptor="Name of Supervisory">
<wd:ID wd:type="WID">XXXXXXXXXXXXXXXXXXX</wd:ID>
<wd:ID wd:type="Organization_Reference_ID">XXXXXX</wd:ID>
4

1 回答 1

1

rs:Descriptor是一个属性,属性必须@在 XPath 表达式中加上前缀。所以一个工作表达式来获取字符串

监事姓名

可能

/rs:Report_Entry/rs:SuperiorOrganization/@rs:Descriptor

(假设 thers:wd:命名空间是可互换的。)

于 2019-05-13T14:39:12.510 回答