XSLT and XQuery Compared

We've looked at the factors that caused XSLT and XQuery to differ. In this section we examine the differences between the two languages in detail. Wherever possible, I try to explain why the differences exist, though in many cases, the only real explanation is that two different design teams inevitably come up with different answers to the same problem.

As we have seen, XSLT and XQuery share XPath as a common core. In contrasting the languages, therefore, we mainly need to look at the parts outside XPath. However, although there is a single XPath definition, this definition allows some flexibility to the host language, so in practice there are some differences even at the XPath level.

It's worth pointing out that the ...

Get XQuery from the Experts: A Guide to the W3C XML Query Language now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.