我正在用XPath攻击OOXML格式,它包含一些基于0的数组。
我想做的是得到单个元素的索引。
例如:
<parentNode> <childNode type="string" /> <childNode type="integer" /> <childNode type="boolean" /> </parentNode>
在这里,我可以用表达式“//childNode[@type='boolean']”找到所需的元素;现在我只需要用XPath找到它的索引(在本例中,索引应该是2)。
请告知。
Find position of a node using xpath