XQuery is a functional language designed to query and manipulate XML data


XSLT is a transformation language for XML designed to transform structured documents into other formats (such as XML, HTML, and plain text, or, in XSLT 3, JSON)

Kind processing expressive

Quality Example
More expressive

"This kind of processing is most easily done with xslt which is more expressive than xquery"

from question "Eliminate a single element type from XML using XQUERY"

Significantly more appropriate

"Xslt is significantly more appropriate to use than xquery for such kind of tasks"

from question "XQuery update question"

Amenable static analysis

Quality Example

"Xquery works better than xslt for this because it s more amenable to static analysis as it lacks the polymorphism of xslt s template rules"

from question "SAXON Streaming XPath in .NET"

More amenable

"Xquery is more amenable to static analysis than xslt because it lacks the very dynamic template despatch mechanism"

from question "Determine all xpath references / xml elements "used" in an XSLT"

Class problems dimitre

Quality Example
Much better

"As dimitre says xslt is much better at this class of problem than xquery"

from question "XQuery that selects node but omits returning child nodes"

"I hate to answer a request for a solution in language a by suggesting a solution in language b but what you are doing here falls into the class of problems which xslt handles much better than xquery"

from question "Xquery order by two variables not working"


"As for whether to use xslt or xquery the proof is in the pudding xslt is better at transforms and xquery is better at queries"

from question "Why would I choose XSLT or XQuery over the other for html document generation?"


Quality Example

"My usual rule-of-thumb is that xquery is better than xslt for simple tasks whereas xslt is better for complex tasks"

from question "The ways to transform a source xml to another xml"

"Generally i know it sounds banal xslt is better at transformation generating a new document from each source document while xquery is better at query extracting a small amount of information from each source document"

from question "Analysing (tens of) thousands of XML files"

Streaming better

"Saxon-ee supports streaming of large xml documents using xslt or xquery streaming is better supported in xslt than in xquery"

from question "Xml parsing with constant memory usage"


"If your output is going to be similar to your input with small changes then the xslt solution is often a lot simpler than the xquery solution"

from question "XPath/XQuery - Selecting a node while excluding some elements"

More strongly

"Unless you are using the static typing feature xquery is no more strongly typed than xslt"

from question "Why would I choose XSLT or XQuery over the other for html document generation?"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0