Re: Use of XQuery as a Notation

Martin Bryan wrote:

>1) Constructs such as:
>
><big_publishers>
>    FOR $p IN distinct(document("bib.xml")//publisher)
>    LET $b := document("bib.xml")/book[publisher = $p]
>    WHERE count($b) > 100
>    RETURN $p
></big_publishers>
>
>give the impression that XQuery is intended to be used as a notation within
>the contents of XML documents that need to include the results of a query.
>What mechanism should be used to identify that a particulay element is
>defined in terms of the XQuery notation?

Interesting idea.

To my knowledge, nobody has been thinking in terms of XQuery notations. 
There is an obvious need to be able to create XML documents that contain 
dynamic document, similar to ASP and JSP, but so far, our thinking has been 
that the XQuery expression itself, which can look a lot like an XML 
document, constitutes the dynamic document.

With our current syntax, converting an XML document to a dynamic document 
would require significant rewriting of the document (inserting comments and 
quotes in particular places, etc.). We are investigating various ways of 
changing that - no guarantees, but we *are* seeing what we can do.

>2) Where documents contain embedded queries can the queries reference the
>namespaces in force within the document, or can they only reference
>internally defined namespaces?

We are only defining the query language. If some environment similar to ASP 
or JSP were to include XQuery expressions, that environment could choose 
whether to make namespace bindings from the enclosing document environment 
available to the query environment.

>3) For a query to be widely reusable it should be possible to reference it
>from within another document, using something along the lines of
><big_publishers qref="myqueries.xql#id(query2)"/>. How do the Query Working
>Group intend to allow one document to reference a query defined in another
>document in such a way as the result of the query is incorporated into the
>referencing document at the point of reference?

XQuery allows functions to be defined, and we have an issue related to 
importing function 
libraries 
(http://www.w3.org/XML/Group/2001/02/xquery-issues.xml#xquery-function-library). 
I would like to see us do that for Level 1.

We are tentatively leaning toward not defining views in Level 1 
(http://www.w3.org/XML/Group/2001/02/xquery-issues.xml#xquery-persist-views-functions).

These are the mechanisms of reuse that I can recall discussing so far.

Jonathan

Received on Thursday, 22 February 2001 12:56:16 UTC