[xquery-talk] XQuery and Web 2.0

Michael Kay mike at saxonica.com
Fri Apr 25 12:58:42 PDT 2008


> 2) What is it about XQuery that would stop you being able to 
> write your entire application in XQuery?

The #1 reason I have found it hard to write significant applications in
XQuery is the lack of polymorphism.

If you want to write a simple query to do a single well-defined job, XQuery
works very well. If you want to write an application capable of doing
different tasks under different circumstances, with reuse of internal
components, and variety in the input documents (or output documents), then
the absence of any kind of polymorphism really starts to hurt.

XSLT has two facilities - template rules and import precedence - that give
it a major advantage once you are doing anything more substantial than a
one-off task using a couple of hundred lines of code.

I'd be interested to hear from people who have developed substantial
applications in XQuery (like markmail) how they got around this problem.

XQuery was designed as a query language and it does that job very well. It
was not designed as a general-purpose programming language, and I think it's
a mistake to try and use it as one.

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



More information about the talk mailing list