Expressions

The XPath standard defines the syntax of a text string, called an ' expression', that consists of instructions for selecting objects, such as elements, within an XML document. The following simple expression selects a Title element that is the child of a Book element:

book/title


   <book>
     <title>...</title>
     ...
   </book>

Expressions may also be used to select attributes, comments, processing instructions and the text content of an element. The term node is used to represent every item of significance in an XML document, including elements. The reserved function 'node()' represents any such item. The reserved node-test functions 'text()', 'processing-instruction()' and 'comment()' represent any object of these specific types. Note that ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.