Hi Tsvetanka,
BaseX produces the result:
<b id="b1" idref="a1 a2">bb1</b> <b id="b2" idref="a3 a11">bb2</b> that is different from: <b id="b1" idref="a1 a2">bb1</b>
The following line of code will give you the expected results (but it may not be efficient enough for large documents):
return $xml/*[tokenize(@idref, '\s') = 'a1']
Besides, my question is about the function idref()? Is it supported?
As BaseX works without schema support, id() and idref() also return results for XML documents that have no schema attached.
BaseX requires the name of the attribute-identifier to contain "id" and the name of the attribute with references to contain 'idref'. But the function idref() returns result only if the relationship is one-to-one.
True. I will have a closer look at this. Let's see what we can do!
Thanks for your observation, Christian