Sign In/My Account | View Cart  
advertisement

Article:
 Processing RSS
Subject: XQuery and XSLT
Date: 2003-04-18 21:40:44
From: Per Bothner
Response to: XQuery and XSLT

> So why are both needed?


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. 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.


This is of course a gray boundary. It is possible to compile and statically analyze at least a subset of XSLT, and it is possible to do quick-and-dirty scripting in XQuery. But your point about "deeper support for XML Schema data types" goes beyond Schema: Having a statically analyzable syntax and type system allows you to catch type errors as compile-time errors rather than run-time errors which I think is very valuable.


No Previous Message Previous Message Move up to Parent Message Up Next Message Next Message


Titles Only Full Threads Newest First
  • XQuery and XSLT
    2003-04-19 13:13:25 Oleg Tkachenko [Reply]

    Come on, XSLT is not a "special-purpose scripting language", it's turing complete functional language, look at FXSL library as a prominent example.
    And XSLT is designed to allow compiation, that's why xsl:include cannot be dynamic and there is no dynamic XPath evaluatuion even in XSLT2. Moreover, *all* XSLT processors I'm aware do compile XSLT stylesheets and do optimize from //* stuff to tail recursion, that's all pretty possible even in XSLT1.0.
    XQuery and XSLT2 really look extremelly similar, except for syntax, but does syntax matter?
    "XQuery is XSLT with no templates" (c)Jeni Tennison probably.


Sponsored By: