From: Leif-Jöran O. <el...@gm...> - 2008-04-23 23:24:41
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 - ----- Ursprungligt meddelande ----- @A@ skrev @D@: |> Assuming your predicate selects some document-nodes and 'root' is the |> name of the outermost-element... |> collection('/db/my-collection)/root[predicate][1] | | I tried something like this but it returns the first /root of every doc in | the collection. Something like this above does exactly what you tell it to do. The compounded predicates above is the equivalent of saying [predicate-clause1 AND fn:position() = 1]. But you say you want the first element node in the sequence matched by your predicate predicate, which is: (collection('/db/my-collection)/root[predicate])[1] not collection('/db/my-collection)/root[predicate][1] Combine this with fn:document-uri(fn:root(of your element node above)) and I think you get what you asked for in the first place, or? Leif-Jöran -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFID8UPhcIn5aVXOPIRAqouAJwMPTOv2qBIu9QF62psgQvEyEipuwCgotbW cZ8z2C/NrCr9Xuo+/Z+Hdvo= =3W7Y -----END PGP SIGNATURE----- |