<libroxml
version="3.0.2"
/>
|
starting point from any given node | n1/n2/n3 |
starting point form root even if current node is different | /n0/n1/n2/n3 |
access all nodes | * |
access only element nodes | node() |
access only text nodes | text() |
access only comment nodes | comment() |
access only processing-instruction nodes | processing-instruction() |
Attribute string value | /n0[=value] |
Attribute int value | /n0[@a=value] |
Attribute int value | /n0[@a!=value] |
Attribute int value | /n0[@a<value] |
Attribute int value | /n0[@a>value] |
Attribute int value | /n0[@a<=value] |
Attribute int value | /n0[@a>=value] |
Node position | /n0[first()] |
Node position | /n0[first()+2] |
Node position | /n0[last()] |
Node position | /n0[last()-3] |
Node position | /n0[position() = 0] |
Node position | /n0[position() != 0] |
Node position | /n0[position() > 1] |
Node position | /n0[position() < 2] |
Node position | /n0[position() >= 1] |
Node position | /n0[position() <= 2] |
Node position | /n0[position() <= 2]/n1 |
Node position | /n0[2] |
Node with namespace | //*[namespace-uri() = 'http://test.com'] |
Other xpath | /n0[n1/@attr] |
Children | /n0/n1/n2 |
Attributes | /n0/n1/@a |
Descendent or self::node() | /n0//n3 |
Parent | /n0/n1/../n1/n2 |
Self | /n0/n1/./n2 |
Node in namespaces | /test::n0 |
Nodes | /n0/n1/child::a |
Attributes | /n0/n1/attribute::a |
Descendent or self | /n0/descendant-or-self::n5 |
Parent | /child::n0/child::n1/parent::/n1 |
Self | /child::n0/child::n1/self:: |
Preceding | preceding::n1 |
Following | following::n1 |
Ancestor | ancestor::n2 |
Ancestor-or-self | ancestor-or-self::n2 |
Namespace | namespace::test |