Difference between XPath, XQuery and XPointer

What is the difference between XPath , XQuery and XPointer ? As far as I know, XQuery is an enhanced version of XPath . I have some basic XPath knowledge. Is there any function in XPath that is not in XQuery ? Yesterday I heard a new word XPointer . I'm confused. What language is used for this purpose?

+47
xml xquery xpath
May 29 '09 at 5:42 a.m.
source share
4 answers

Wikipedia is a good place to start these questions. Typically, XPath is the language used to pinpoint exact XML nodes in the DOM. XQuery is a superset of XPath that also provides FLWOR , which is similar to SQL. Finally, XPointer includes XPath, but also provides a simpler addressing scheme for positions.

Of course, you can always read the W3C specifications for full details.

+52
May 29 '09 at 5:58 a.m.
source share

Although Matthew's answer gives a good first impression, there is much more to talk about the standards mentioned, and there are many others that are related. There is a good article from the online Holland XML user group magazine that talks a lot about the history of XQuery and looks at these various standards in perspective. The first part is important here:

XQuery stands for XML Query Language . This already speaks to the point. It is a language for selecting subsets and substructures from a large set of XML files. The result can be manipulated with what is suitable for use, for example, for the subsequent process or for displaying in a web browser. XPath is used a lot in XQuery.

All XML standards have their own capabilities. Ill to name a few. XSLT is a language for converting XML to another format. XPointer is an XPath extension for more precisely defining nodes in XML fragments or even substrings of nodes. XLink is the standard for defining relationships. XInclude is the standard for compiling multiple XML fragments into one using, for example, XLink relationships. And XProc is a standard with which you can describe how to process XML documents to get the desired end result. It is expressed in XML and describes a step-by-step process, also called XML pipelines. In XProc, you use ao XQuery, XSLT, and XInclude (and thus indirectly XPath, XPointer, and XLink) to express what needs to be done exactly at every step.

All of these standards are related to each other. They are connected to each other and depend on each other. The match between some of the mentioned XML standards is very well described in the following image, which you can also find in W3Schools :

What is XPath

The full article can be found here: http://grtjn.blogspot.nl/2011/10/xquery-novelties-revisited.html

NTN!

+35
Dec 18 '13 at 9:10
source share

Well, I think XQuery is worth distinguishing. XPath and XPointer are almost the same and are used to select XML nodes. XQuery, on the other hand, is a fairly large XPath extension. For example, this makes it possible to declare custom functions. So this is more like a programming language that works natively with XML. You can see a few examples here: embedding-xquery-in-java

Hello

+16
Jan 23 '10 at 19:11
source share

XPath is intentionally limited to reading existing nodes.

Like XSLT, XQuery can create nodes. It can also update nodes (using the XQuery updater).

From my point of view, an XQuery developer; -)

+3
Jul 08 '16 at 6:06
source share



All Articles