Subject:About typing system for XQuery in Stylus Author:Zhen Wang Date:22 Oct 2006 05:06 AM
Is the typing system for XQuery in Stylus implemented according to the formal semantics of XQuery (http://www.w3.org/TR/xquery-semantics/)?
If so, which version is it?
Are those typing rules encoded in the implementation?
Subject:About typing system for XQuery in Stylus Author:(Deleted User) Date:23 Oct 2006 10:33 AM
The internal XQuery processor implements the latest XQuery specs (June 8th 2006), including the formal semantics; it doesn't implement the optional "static typing" feature.
>Are those typing rules encoded in the implementation?
I am not sure I understand what you mean by "encoded in the implementation"; if you are hoping that the schema types are loaded at runtime from a set of data files, this is not true.
Subject:About typing system for XQuery in Stylus Author:Zhen Wang Date:23 Oct 2006 11:04 AM
So, even if the users speify an XML Schema for an XQuery expression, the Stylus implementation will not load type information from the XML Schema, and it will not do static type analysis, is it?
Subject:About typing system for XQuery in Stylus Author:(Deleted User) Date:23 Oct 2006 11:19 AM
>So, even if the users speify an XML Schema for an XQuery
>expression, the Stylus implementation will not load
>type information from the XML Schema, and it will not do
>static type analysis, is it?
No, the internal XQuery processor *does* support the "schema import" feature (chapter 5.2.1 of the specs),
so if you have a query with a "import schema '...' at '...'" expression, the schema will be loaded and the types will be available during the evaluation.
The "static typing" feature (chapter 5.2.3 of the specs) is the capability of detecting run-time errors even before evaluation starts: e.g. if a loaded schema defines a 'book' type that has 'title' and 'subject' as child elements, and the query contains an XPath expression //book/author, that expression can be replaced with an empty sequence, as 'author' is not defined as valid child of 'book'. The internal XQuery processor will not perform such optimization and will have to run the query in any case.
If you need to use a processor that supports the "static typing" feature, have a look at the DataDirect XQuery processor (http://www.datadirect.com/products/xquery/index.ssp)