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: <Book> Here is the XPath expression: /Book/Author The semantics of that XPath expression are the values returned when evaluating the XPath expression on the XML document. These are the values
returned:
That’s the semantics of the XPath expression. Here is an XPath expression with identical semantics, but different syntax:
/Book/*[self::Author] 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. Comments? /Roger |