OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
The meaning of “semantics” and “syntax” in XPath

Hi Folks,

The meaning of the word “semantics” is fuzzy in the realm of data interoperability. But in XPath the meaning of “semantics” and “syntax” is clear:

Semantics: the value returned from evaluating the XPath expression.

Syntax: the form of the XPath expression.

Example: Let’s illustrate the use of these terms with an XPath expression for querying this XML document:

<Title>Parsing Techniques</Title>
<Author>Dick Grune</Author>
<Author>Ceriel Jacobs</Author>


Here is the XPath expression:




The semantics of that XPath expression are the values returned when evaluating the XPath expression on the XML document. These are the values returned:

<Author>Dick Grune</Author>
<Author>Ceriel Jacobs</Author>


That’s the semantics of the XPath expression.


Here is an XPath expression with identical semantics, but different syntax:




Why does the XPath language allow expressions with different syntax and identical semantics?


The rationale, in this example, is that it allows a syntactic distinction to be made between dereferencing a field in a composite object (with the slash operator) and performing an indexed lookup (with the predicate), even though there is no semantic distinction between the two.





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS