[xquery-talk] Comparing XQuery to XSLT

Michael Kay mhk at mhk.me.uk
Tue Aug 19 20:30:24 PDT 2003


I think the main advantages of XQuery 1.0 over XSLT 2.0 are

(a) concise syntax. Largely a cosmetic/psychological benefit, but a real
one. In practice, though, I worry about what a 1000-line XQuery is going
to look like. The XML-based syntax of XSLT has some practical advantages
when you get to this scale.

(b) joins. For people who think in SQL terms, or whose data is organized
in a tabular form, complex joins are definitely easier to express in
XQuery than in XSLT.

(c) database orientation. This isn't really a language feature but it's
a feature of the way most implementors will be implementing the language
- processors will be designed to handle gigabytes of persistent data,
not megabytes of in-memory data.

In terms of functionality, XSLT 2.0 has many things that XQuery lacks:
template rules, grouping, analyze-string, keys, multiple output files,
serialization control, format-number, format-date, xsl:number,
generate-id, a full set of axes.

One thing I hope eventually to do in Saxon is to allow interoperation
between the XSLT and XQuery sides of the product, so you can get the
best of both worlds by mixing languages.

Michael Kay


> -----Original Message-----
> From: talk-bounces at x-query.com 
> [mailto:talk-bounces at x-query.com] On Behalf Of Mike Clark
> Sent: 19 August 2003 17:18
> To: Jeni Tennison
> Cc: talk at x-query.com
> Subject: [xquery-talk] Comparing XQuery to XSLT
> 
> 
> 
> So for those with XSLT experience, I'd be interested to hear your 
> opinions on what XQuery brings to the table.  As the spec 
> matures it's 
> likely to be a reoccurring and important conversation, as Michael 
> pointed out.  And since I've already shown how little I know 
> about their 
> differences (thanks, Jeni!), I thought I'd go ahead and start 
> tugging on 
> the thread.
> 
> It's not my intent to provoke a flame war.  I'm here to learn 
> from the 
> collective wisdom of the group.
> 
> Mike
> 
> _______________________________________________
> talk at x-query.com
> http://www.x-query.com/mailman/listinfo/talk
> 



More information about the talk mailing list