Re: XQuery WG comments on XProc specification

On Wed, Jun 4, 2008 at 8:08 AM, Michael Kay <mike@saxonica.com> wrote:
> Personally, I think that because a large subset of
> queries are in fact well-formed XML, we ought to be able to define some kind
> of subset of XQuery that acknowledges this subset of the language and allows
> it to be passed around directly (I think Orbeon does something like this
> today). But that goes well beyond anything the WG has discussed.

Exactly. Right now we do support two modes:

a) One mode where the XQuery is passed as text inside an element. We
add a xsi:type="xs:string" on the root element to signal we are in
this mode. (Most likely an attribute would make more sense for XProc.)
So for instance:

<xquery xsi:type="xs:string">
    &lt;answer&gt;{ 40 + 2 }&lt;/answer&gt;
</xquery>

b) Another mode where the query is written more naturally as:

<xquery>
    <answer>{ 40 + 2 }</answer>
</xquery>

In this case, it is as if the text of the XQuery was built by
serializing the document and considering in the serialized text what
comes between the opening tag and closing tag as the query.

Mode A is most useful when the XQuery is provided as text (typically
because it is provided to the pipeline as such). Mode B is typically
useful when the XQuery is written as-is in the pipeline.

Alex
-- 
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet

Received on Thursday, 5 June 2008 00:55:13 UTC