首页 > 解决方案 > XPath for Descriptor in Node

问题描述

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>

标签: xmlxsltxpathworkday-api

解决方案


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

监事姓名

可能

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

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


推荐阅读