Expressions and Wildcards in XPath
General
XML
XPath
- explains expressions in XPath
- explains wildcards
Description :
Expressions and Wildcards
| Expression | Description |
|---|---|
| nodename | Selects all nodes with the name "nodename" |
| / | 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 |
| * | Matches any element node |
| @* | Matches any element node |
| node() | Matches any node of any kind |
| name() | specifies the name of the element |
| Local-name() | specifies the shorten name of the element |
| Namepsace-uri() | specifies the namspace URI |
| position() | specifies the position of the element starting from 1 |
| text() | specifies the content of the element |
Example :
| Example | Description |
|---|---|
| /bookstore/* | Any node in the bookstore element |
| //* | Any node in the document starting from the current node |
| //title[@*] | Any node that has “title” name and any attribute starting from the current node |
2025 Jan