|
>Home>Learn XQuery>White Papers>XQuery Myths>XQuery will replace XSLT
Print
Myth: XQuery will replace XSLT
XQuery and XSLT have enough developer momentum behind them that both will co-exist. In fact, the most recent specifications for XQuery 1.0 and XSLT 2.0 are being produced in tandem.
Where XQuery and XSLT overlap is in the problems they solve: transformation of XML data, federation of XML collections, and advanced query of XML data. Developers will continue to see debates about the capabilities of each, including plenty of myth and misunderstanding. For example, I often see the claim that XQuery's ability to query multiple, disparate sources in one pass gives it a distinct advantage over XSLT. In fact, XSLT 2.0 processors can have multiple nodes supplied as an input sequence. XSLT 1.0 has the document() function for accessing multiple sources within a single transformation, and XSLT 2.0 supports the new collection() function. I also often hear the claim that while XQuery syntax looks nicer, it lacks XSLT's template style pattern matching. While this might be true, I fully expect XQuery to add that function too. In the end, developers can expect improvements and challenges in both technologies that will keep them close to one another in terms of function and capability.
Finally, there is the issue of the developer's thick skull. The XSLT presentations I have attended have left me feeling like I didn't really get it. XSLT is a transformation syntax that does not have a main() or start method like the Java and Jython code I normally write. At times, an XSLT script looks non-deterministic to me. So I haven't really gotten my head into XSLT. XQuery looks like SQL and solves many of the SQL problems that cause me to run back to my bookshelf for answers.
|