> XPath expressions are evaluated against all documents in a
> MarkLogic database:
>
> /foo/bar

Just for the record, the spec 
(http://www.w3.org/TR/xquery/#id-path-expressions) states the following:

"A "/" at the beginning of a path expression is an abbreviation for the initial 
step fn:root(self::node()) treat as document-node()/ (however, if the "/" is 
the entire path expression, the trailing "/" is omitted from the expansion.) 
The effect of this initial step is to begin the path at the root node of the 
tree that contains the context node. If the context item is not a node, a type 
error is raised..." (etc etc)

In short, when using an xpath like that without any further context, Xquery 
implementations should actually complain. If I am not badly mistaken. Though I 
find this really convenient.

Personally, I prefer adding a doc() in front of the expression. This is also 
non-conformant actually, but a really handy way of getting access all document 
nodes in the database.

A more conformant way would be using collection(), which should return all 
document nodes of documents in the default collections (I guess that means 
here: those not in collections)..

Just my two cents.. ;-)

Kind regards,
Geert


Drs. G.P.H. Josten
Consultant


http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.



_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to