Alex Rivera | Logout

XQuery vs XSLT for transforming data

Asked 2010-06-09T07:29:49.633
19

What do you use in your applications for transforming XML data to other data types? WHY?

Edit
Report

1 Answer

14

While XQuery can be used for simple transformations, it lacks the power and sofistication of XSLT (especially templates and the <xsl:apply-templates> instruction).

XSLT is a language that was especially designed to process tree structures. It is still best at doing this.

In cases when accessing an XML database it would be a good decision to use (the efficiency of) XQuery to extract the necessary XML nodes and then do the transformation with XSLT from here on. Some XSLT 2.x / XQuery processors do allow this (via extensions) even now. The next wave of XSLT 2.x/XQuery 1.x specifications will most probably make such interoperability an official feature of these languages.

answered 2010-06-09T12:59:22.767

Your Answer