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

XML Query Use Case NS, query 1

From: Michael Dyck <MichaelDyck@home.com>
Date: Tue, 15 May 2001 00:53:00 -0700
Message-ID: <3B00E05B.3116F3A5@home.com>
To: www-xml-query-comments@w3.org
XML Query Use Cases
W3C Working Draft 15 February 2001

Use Case NS Q1

The Solution in XQuery uses a function named "namespace_uri". If this is
intended to be a reference to the XPath function, then:
(a) it should be spelled with a hyphen, not an underscore; and
(b) the solution won't work. The XPath function is defined to return:
        the namespace URI of the expanded-name of the node in
        the argument node-set that is first in document order.
    (rather than the namespace URI of the expanded-name of *each* node in
    the argument node-set, as you presumably intended).
You could replace
    FOR $x IN //* RETURN namespace-uri($x)

But even with that replacement, it still doesn't do what you want, because
it only returns the namespace URI of the expanded-name of each *element* in
the document. Thus, it misses these URIs:
because they are only used for *attribute* names.
So you should replace

The newline() function is not defined.

There's nothing in the spec to indicate that '+' performs string
concatenation.  You could replace
    $n + newline()
    [ $n, newline() ]

-Michael Dyck
Received on Tuesday, 15 May 2001 03:55:28 UTC

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