Pattern Syntax
The XPath pattern syntax is described formally in the XPath specification.
Here we're going to look at the syntax in abstract, but less formal terms:
-
An XPath pattern is a 'location path', a location path is
absolute if it begins with a slash ("/") and relative otherwise
-
A relative location path consists of a series of steps, separated
by slashes
-
A step is an axis specifier, a node test, and a predicate
The formal syntax is made more complicated by the fact that it must
describe both the abbreviated and unabbreviated syntaxes