0

我有一个如下所示的 XML 结构:

<document>
<body>
<section>
<title>something</title>
<subtitle>Something again</subtitle>
<section>
<p xml:id="1234">Some text</p>
</section>
</section>
<section>
<title>something2</title>
<subtitle>Something again2</subtitle>
<section>
<p xml:id="12345678">Some text2</p>
<p getelement="1234"></p>
</section>
</section>
</body>
</document>

我想搜索“getelement”中定义的属性值。我在这里从一个友好的灵魂那里得到了这段代码:

//section[section/p[@xml:id=@getelement]]/subtitle

但它不起作用,我不能使用 current(),因为 Arbortext 不支持它。

4

1 回答 1

0

您正在比较同一元素的属性,但事实并非如此。你必须找到getelement

//section[section/p[@xml:id=//@getelement]]/subtitle

另请注意,xml:id属性不能以数字开头。

于 2013-02-15T13:24:18.967 回答