次の XML ドキュメントがあります。
<text xmlns:its="http://www.w3.org/2005/11/its" >
<its:rules version="2.0">
<its:termRule selector="//term" term="yes" termInfoPointer="id(@def)"/>
</its:rules>
<p>We may define <term def="TDPV">discoursal point of view</term>
as <gloss xml:id="TDPV">the relationship, expressed through discourse
structure, between the implied author or some other addresser,
and the fiction.</gloss>
</p>
</text>
termInfoPointer
<gloss xml:id="TDPV">
要素を指す XPath 式です。
LINQ-to-XML を使用して選択します。
XElement term = ...;
object value = term.XPathEvaluate("id(@def)");
次の例外が発生します。System.NotSupportedException: This XPathNavigator does not support IDs.
この問題の解決策が見つからなかったのでid()
、他の式に置き換えようとしました:
//*[@xml:id='TDPV'] // works, but I need to use @def
//*[@xml:id=@def]
//*[@xml:id=@def/text()]
//*[@xml:id=self::node()/@def/text()]
しかし、これらの作品のどれも。
それを実装id()
または別の式に置き換える方法はありますか?
id()
この式はid(@def) | id(//*[@attr="(id(@abc()))))))"])
.