BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


XQuery
XQuery 1.0 syntax types and some query examples.
How to use XQuery in ASP.NET
Learn XQuery 1.0 fundamentals


 
 

<< XmlSerializerXSLT >>


By Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First Posted 01/23/2002
Times viewed 423

Why do I need XQuery when I already have XSLT/XPath?


Summary XQuery is seen by many as being very similar to XSLT. This may be true to some degree, but there are some significant differences that I'll try to explain here, which make XQuery a querying language, rather than a transforming language, like XSLT.

I'm sure that there are a lot of people out there asking themselves and others the following questions:

* What is the relation between XQuery and XSLT?
* Why do we need another XML Processing Language when we have XSLT?
* What are the differences between XQuery and XSLT/XPath?
* When should I use XQuery and when XSLT?

These questions can only best be answered if you know where XQuery came from, and if you know about the limitations of XPath, and also if you know what purpose both languages have. I'll try to explain the questions here by categorizing some principal aspects of both languages.

XSLT is a transforming language. It uses XPath 1.0 (and will eventually also use XPath 2.0) to navigate around in an XML source file. It is very useful for transforming XML into XML, XML into any Text format, but also Text into XML. It is, however, single-document based. Besides that, it is not very suitable for large XML documents because it needs to build up the source in memory. Also, it does not support updates for the input XML source document.

XQuery is more a querying language; it also uses XPath 1.0 (and also uses XPath 2.0) for adressing an XML source document, but has additional SQL-like querying capabilities. It can handle document collections or query a native XML database, or a relational one. It is intended for use with large documents or database tables. And, XQuery will have support for modifying the input XML source.

Resuming, it is likely that XQuery will probably mainly be used when you need to process multiple, large XML sources like documents, document collections, especially when taken from relational databases. XSLT 1.0 is just not suitable to do that kind of job, but has its own qualities, like for example single document based XML to (X)HTML transformation.

Additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XmlSerializerXSLT >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML