Pondering those web technologies that may change the future of the world wide web.
10/16/2005; 1:29:24 AM
The XML Query Working Group has released an updated Working Draft of XML Syntax for XQuery 1.0 (XQueryX). Designed to be read with the XQuery language and its formal semantics, the document proposes that XQueryX will be an optional conformance level. The Working Group invites comments.[World Wide Web Consortium]
I missed the previous draft, which is 2.5 years old. My first impression: weird. Being used to XSLT, I had not expected that the XPath expression would also be converted to XML. But the XQuery designers see XQuery as an extension to XPath, so it makes sense that way. It also makes XQueryX more interesting.
The XML is full of constructs like this:
<xqx:expr xsi:type="xqx:flworExpr">
I find this very ugly. This is probably done because xqx:expr
is allowed at a lot of places, and there are numerous subtypes of xqx:expr
. But adding the following line to the schema would make it possible to simply write <xqx:flworExpr>
<xsd:element name="flworExpr" type="flworExpr" substitutionGroup="expr" />
Just to play with it (it's so much easier to play with a language when the parser is ubiquitously available), I created an XSLT stylesheet that tries to transform XQueryX to XSLT. It created XSLT 1.0 stylesheets, but if XPath 2.0 functions are used (like distinct()
) the version has to be changed to 2.0 to get a valid XSLT document. Here are the converted examples: example 1, example 2, example 3.