W3C home > Mailing lists > Public > www-xml-query-comments@w3.org > March 2001

XQuery: document() function

From: Michael Dyck <MichaelDyck@home.com>
Date: Sat, 03 Mar 2001 17:03:22 -0800
Message-ID: <3AA1945A.293B6F69@home.com>
To: www-xml-query-comments@w3.org
XQuery: A Query Language for XML
W3C Working Draft 15 February 2001

Section 2.1 (Path Expressions) introduces "the function document(string),
which returns the root node of a named document." But by "the root node", do
you mean XML Query Data Model's DocNode (which XPath refers to as the root
node), or the ElemNode returned by its "root" accessor (which is variously
referred to as the document element, root element, or top-level element).

If you mean the DocNode, then the following expressions are incorrect:
    document("zoo.xml")/chapter[...]  (three times)
    document("bib.xml")/book[...]     (twice)
    depth(document("partlist.xml"))   (because depth's arg is an ELEMENT)
    document("company.xml")/emp[...]  (twice)
  (and in the Use Cases:)
    document("prices.xml")/book/title (implicitly, in

On the other hand, if "root node" means the top-level element, these are
  (in the Use Cases:)
    document("http://www.bn.com")/bib/book (4 times)

-Michael Dyck
Received on Saturday, 3 March 2001 20:07:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:12 UTC