I can't get the XQuery function fn:idref()
to return anything.
I have this XML document doc.xml;
<doc>
<foo idref="xyz"/>
<bar xml:id="xyz"/>
</doc>
And this XQuery;
let $d := doc("doc.xml")
return $d/idref("xyz")
But the result is always empty. I'm guessing that the attribute idref="xyz"
needs to be declared as type idref
but can that be done without a schema?
I'm using Saxon XQuery 1.0 processor.