Zdrasti Tsvetanka! I think your problem is a question of XQuery, and not BaseX. When I run the following script: let $i := <root> <a id = "a1" idref = "b1"> aaa1</a> <a id = "a2" idef = "b1">aaa2</a> <a id = "a3" idef= "b2"> aaa3</a> <b id = "b1" idref = "a1 a2">bb1</b> <b id = "b2" idref = "a3">bb2</b> </root> return $i/*[matches(@idref, 'a1')] BaseX produces the result: <b id="b1" idref="a1 a2">bb1</b> The same happens when I use expression $i/*[contains(@idref, 'a1')]. 'a1' is only part of the @idref value. Best, Neven Neven Jovanovic Zagreb Hrvatska / Croatia On 2 February 2014 18:59, Tsvetanka Georgieva-Trifonova <cvetygeorg@yahoo.com> wrote:
Hi BaseX, My question is about function idref(). How it should be applied in case of one-to-many relationships? For example: <root> <a id = "a1" idref = "b1"> aaa1</a> <a id = "a2" idef = "b1">aaa2</a> <a id = "a3" idef= "b2"> aaa3</a> <b id = "b1" idref = "a1 a2">bb1</b> <b id = "b2" idref = "a3">bb2</b> </root> The expression: idref("a3")/.. gives the following result: <b id="b2" idref="a3">bb2</b> But the expression: idref("a1")/.. does not give any result.
Thanks & regards, Tsvetanka
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk