Chapter 8. XPath 2.0 Expressions and Operators

Creating Primary Expressions

The most basic expression type is the primary expression type. This type can be one of these:

  • A literal

  • A variable

  • A function call

  • A context item

  • A parenthesized expression, which is used to control precedence of operators

  • A comment

To understand these in detail, we'll take a look at them one by one.


A literal is just a value that is of an atomic type. As ...

Get XPath: Navigating XML with XPath 1.0 and 2.0 Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.