XQuery and XSLT
2003-10-19 03:33:26 Dimitre Novatchev
[Reply]
> One way to think of them: XSLT is essentially a > special-purpose scripting language. It is
> designed to be interpreted, and there is no
> static type-checking or optimization.
Speking about XSLT 2.0 almost everything in the above statement is quite wrong:
- there *is* static type checking.
- there is optimization performed even in most
XSLT 1.0 processors.
> XQuery aspires to be a real general-purpose
> programming language, albeit one with syntax
> and data types optimized for XML applications.
> It supports (at least optionally) type-
> checking, optimization, and compilation.
So you imply that XSLT is not so real general-purpose programming language than XQuery?
Of course this is not true -- XSLT 2.0 has all major features that XQuery has.
What XQuery doesn't offer and what happens to be one of the most powerful features of XSLT is the mechanism to apply the best-matching template out of many.
There are great consequences from this -- e.g. it is possible to implement higher order functions and functional programming in XSLT (see the FXSL library), while this does not seem possible to be done with XQuery.
Dimitre Novatchev