[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

static typing of XQuery?

Michael Kay mhk at mhk.me.uk
Wed Sep 20 21:06:04 PDT 2006


  static typing of XQuery?
> 
> How much interest is there in the "static typing" feature?

There seem to be two clusters of interest in it: (a) Microsoft, and (b)
academics.

> Which (current, actively maintained, aiming for completeness) 
> implementations implement the static typing feature?
> 
> As the SVN version of Qexo now passes more and more of the 
> testsuite, I'm considering whether to tackle static typing.

I think that schemaless data is an important use case, and in my view
pessimistic static typing is unusable with schemaless data. It requires
constant assertions about cardinality, for example

concat(firstname, lastname)

has to be rewritten as

concat(zero-or-one(firstname), zero-or-one(lastname))

Or perhaps frustrated users will get into the habit of writing

concat(firstname[1], lastname[1])

which is really bad, because it suppresses the run-time type checking.

Doing pessimistic static typing for schema-aware queries is more reasonable,
but there are still many cases where intermediate results are likely to be
untyped. My advice would be to steer well clear. Optimistic static typing
(reporting errors only where the static type is disjoint from the required
type), as implemented in Saxon, seems to be quite good at catching a wide
class of programming mistakes.

Michael Kay
http://www.saxonica.com/



Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.