T
Thomas Schmidt
Given this document:
<doc>
<head>
<someElementWithID id="X"/>
<someElementWithID id="Y"/>
</head>
<body>
<element>
<otherElement>
<elementWithIDREF idref="X"/>
</otherElement>
</element>
</body>
</doc>
With the <elementWithIDREF> as a context node, I want to use an XPath
to get to the <someElementWithID> with the corresponding id-attribute.
If I use
//head/someElementWithID[@id=@idref]
I don't get what I want, because the idref-attribute is evaluated with
someElementWithID as the context. In XSLT, I use
//head/someElementWithID[@id=current()/@idref]
But "current()" is an XSLT function. Is there some way to do this in
"pure" XPath?
Any help will be greatly appreciated,
Thomas
<doc>
<head>
<someElementWithID id="X"/>
<someElementWithID id="Y"/>
</head>
<body>
<element>
<otherElement>
<elementWithIDREF idref="X"/>
</otherElement>
</element>
</body>
</doc>
With the <elementWithIDREF> as a context node, I want to use an XPath
to get to the <someElementWithID> with the corresponding id-attribute.
If I use
//head/someElementWithID[@id=@idref]
I don't get what I want, because the idref-attribute is evaluated with
someElementWithID as the context. In XSLT, I use
//head/someElementWithID[@id=current()/@idref]
But "current()" is an XSLT function. Is there some way to do this in
"pure" XPath?
Any help will be greatly appreciated,
Thomas