[xquery-talk] Re: [Qexo-general] New XQuery article

Per Bothner per at bothner.com
Mon Dec 29 09:53:24 PST 2003


Weiqi Gao wrote:

> I've put a preliminary copy on my personal page at
> http://www.weiqigao.com/articles/xquery-article.html.
> 
> I would really appreciate it if you can take a look at it and let me
> know if there are any glaring mistakes or misconceptions.

A nice little intro.  Here are some notes.

 > Saxon is a complete implementation of XQuery.

The Saxon web site says Saxon 7.8 implements "most of .. the working 
drafts".  The conformance page says "Saxon is 100% conformant to the 
mandatory requirements of these recommendations."  I'm not sure what 
Miachels means by this statement, as there are some known bugs.

 > Qexo is an implementation in progress that supports interactive 
sessions, which is great for learning.

I guess I can't complain too much about this, though I want to make sure 
you don't oversell Saxon's "completeness" compared to Qexo's "in 
progress" - it's a matter of degree:  Saxon's implementation is 
definitely more complete.

It might be nice you added a mention that Qexo compiles XQuery programs 
to Java bytecodes.  This does not guarantee that it performs better of 
course, and in any case most active implementations will see performance 
improvements.

 > java kawa.repl --output-format xml -xquery

The '--output-format xml' isn't really required, as the default is also 
valid XML.  More importantly, you need an extra hyphen:  --xquery.

In the "Nodes and Node Types" sectiuon you might note that the prompt 
changes to indivate the current expression nesting.

 > For example, you can use regular expressions in place of element and 
attribute names.

That's not really true.

 > Notice that the use of return in XQuery is quite different from Java.

Perhaps you should be more specific: "it specifies the result of a 
sub-expression and does not imply returning from a function."

 > Saxon puts an XML declaration in front of every element in the 
sequence when they are printed.

Probably not - I assume just every document node or top-level element.

 > Modules

Qexo 1.7.90 also supports modules, but they are new and I haven't 
documented them yet.  Also, as an implementation restriction (for now) 
modules have to be compiled, and cannot have circular dependencies:

$ java kawa.repl --xquery -C /tmp/lib-fib.xq
$ java kawa.repl --xquery --main -C /tmp/main-fib.xq
$ java 'main$Mnfib'
13

'main$Mnfib' is the "mangled" Java class name of 'main-fib'.
(The library module becomes com/ociweb/jnb.class.)
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/




More information about the talk mailing list