[Home] [By Thread] [By Date] [Recent Entries]

  • From: Michael Kay <mike@s...>
  • To: "Costello, Roger L." <costello@m...>
  • Date: Fri, 16 Sep 2016 13:58:12 +0100

In the world of programming languages, semantics is about the result of executing a program, for example it is concerned with the fact that the result of the XPath expression "London" || "is in" || "England" is the string "London is in England".

This has almost nothing to do with the usage of the term semantics by philosophers, linguists, and "semantic webbers" who are concerned with how to interpret the statement "London is in England" as a proposition concerning the geographic location of the entities referred to as "London" and "England".

Neither usage is fuzzy, but they are very different.


Here is the XPath expression:

 

                /Book/Author

 

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?

 


For usability. There is no need to provide a "+" operator, because the semantics are the same as "--" (2+2 always gives the same result as 2 - - 2). But a "+" operator is very convenient, so the fact that it's redundant really doesn't matter. Minimalism is a reasonable aim, but not if you take it to extremes.

Michael Kay
Saxonica




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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member