XPath Syntax Quick Reference

This topic provides a quick reference for XPath expression syntax.

Axes

XPath provides the following axes:

Node Tests

XPath provides the following node tests:

Filters

A filter specifies a constraint on a node set with respect to an axis to produce a new node set.

Location Steps

A location step has the following format:

AxisSpecifier::NodeTest[Filter][Filter]... 

XPath Expression

An XPath expression has one of the following formats:

LocationStep[/LocationStep]... 
FunctionCall()[Filter]/LocationStep[/LocationStep]... 
(Expression)[Filter]/LocationStep[/LocationStep]... 

A function call or an XPath expression in parentheses can appear only at the very beginning of an XPath expression. An expression in parentheses always returns a node set. Any function that appears at the beginning of an XPath location step expression must return a node set.

 
Free Stylus Studio XML Training: