← Back to context

Comment by oever

6 months ago

Every mention of XSLT should mention XQuery. XQuery has roughly the same features as XSLT. They share the functions and data model. The syntax of XQuery is much nicer though.

XSLT/XQuery 3.0 versus 1.0 is a big upgrade. It includes JSON support and static type checking. At work, our webpage with thousands of pages is statically generated with XQuery 3.

XQuery has a different focus from XSLT. XQuery doesn’t have apply-templates, the document-based implicit dispatch that is so central to XSLT, and it doesn’t have the multiple inheritance possible with overloading templates, but it is stronger in the area of modules, and it assumes (in design) an index, a database.

Programmers tend to prefer XQuery syntax, but note that XPath 3 moves XSLT in that direction too, and XSLT 4 will take it further.

The main strength of XSLT for me is that, together with XML, it enables people who do not consider themselves programmers to do advanced text processing.