Node Tests

The axis chooses the direction to move from the context node. The node test determines what kinds of nodes will be selected along that axis. The node tests are:

Name

Any element or attribute with the specified name. If the name is prefixed, then the local name and namespace URI are compared, not the qualified names. If the name is not prefixed, then the element must be in no namespace at all. An unprefixed name in an XPath expression never matches an element in a namespace, even in the default namespace. When using XPath to search for an unprefixed element like ATOM that is in a namespace, you have to use a prefixed name instead such as chem:Quote. Exactly how the prefix is mapped to the namespace depends on the environment in which the XPath expression is used.

*

Along the attribute axis the asterisk matches all attribute nodes. Along the namespace axis the asterisk matches all namespace nodes. Along all other axes, this matches all element nodes.

prefix:*

Any element or attribute in the namespace mapped to the prefix.

comment()

Any comment

text()

Any text node

node()

Any node

processing-instruction()

Any processing instruction

processing-instruction('target')

Any processing instruction with the specified target


Previous | Next | Top | Cafe con Leche

Copyright 2002 Elliotte Rusty Harold
Elliotte Rusty Harold
Last Modified October 15, 2002