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

1.7.4.1 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
    namespace_uri(//*)
with
    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:
    http://www.w3.org/1999/xlink
    http://www.AuctionMediatorCompany.com/auctioneers#yabadoo
    http://www.w3.org/1999/XMLSchema-datatypes
because they are only used for *attribute* names.
So you should replace
    //*
with
    (//*|//@*)


The newline() function is not defined.


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

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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 2 February 2007 00:13:02 GMT