XPath
Table of contents
Expression Description ————— ——————————————————————————————————- nodename Selects all child nodes of the named node / Selects from the root node // Selects nodes in the document from the current node that match the selection no matter where they are . Selects the current node .. Selects the parent of the current node @ Selects attributes @* Selects all attributes @c attributes c node() all nodes text() text node a | b a or b element a[expression] a node when expression is true * all elements a/b selects b child of parent a a//b selects b child when has a node upon it
Expression Description —————– —————————————————————————————————————————— bookstore Selects all the child nodes of the bookstore element
/bookstore Selects the root element bookstore\ Note: If the path starts with a slash ( / ) it always represents an absolute path to an element!\ bookstore/book Selects all book elements that are children of bookstore
//book Selects all book elements no matter where they are in the document
bookstore//book Selects all book elements that are descendant of the bookstore element, no matter where they are under the bookstore element
//@lang Selects all attributes that are named lang ————————————————————————————————————————————————
Operators
operator description ———- ————————– | Computes two node-sets
- Addition
- Subtraction * Multiplication div Division = Equal != Not equal < Less than ⇐ Less than or equal to > Greater than >= Greater than or equal to or or and and mod Modulus