XML Services supports the following XPath syntax:
xpath::= or_expr or_expr::= and_expr | and_expr TOKEN_OR or_expr and_expr::= union_expr | union_expr TOKEN_AND and_expr union_expr::= intersect_expr | intersect_expr TOKEN_UNION union_expr intersect_expr::= comparison_expr | comparison_expr TOKEN_INTERSECT intersect_expr comparison_expr::= range_exp | range_expr general_comp comparisonRightHandSide general_comp::= TOKEN_EQUAL | TOKEN_NOTEQUAL | TOKEN_LESSTHAN | TOKEN_LESSTHANEQUAL | TOKEN_GREATERTHAN | TOKEN_GREATERTHANEQUAL range_expr::= unary_expr | unary_expr TOKEN_TO unary_expr unary_expr::= TOKEN_MINUS path_expr | TOKEN_PLUS path_expr | path_expr comparisonRightHandSide::= literal path_expr::= relativepath_expr | TOKEN_SLASH | TOKEN_SLASH relativepath_expr
| TOKEN_DOUBLESLASH relativepath_expr relativepath_expr::= step_expr | step_expr TOKEN_SLASH relativepath_expr | step_expr TOKEN_DOUBLESLASH relativepath_expr step_expr::= forward_step predicates | primary_expr predicates | predicates primary_expr::= literal forward_step::= abbreviated_forward_step abbreviated_forward_step::= name_test | TOKEN_ATRATE name_test | TOKEN_PERIOD name_test::= q_name | wild_card| text test text_test ::= TOKEN_TEXT TOKEN_LPAREN TOKEN_RPAREN literal::= numeric_literal | string_literal wild_card::= TOKEN_ASTERISK q_name::= TOKEN_ID string_literal::= TOKEN_STRING numeric_literal::= TOKEN_INT | TOKEN_FLOATVAL| | TOKEN_MINUS TOKEN_INT | TOKEN_MINUSTOKEN_FLOATVAL predicates::= | TOKEN_LSQUARE expr TOKEN_RSQUARE predicates | TOKEN_LSQUARE expr TOKEN_RSQUARE
The following tokens are supported by the XML Services subset of XPath:
APOS ::= ''' DIGITS ::= [0-9]+ NONAPOS ::= '^'' NONQUOTE ::= '^"' NONSTART ::= LETTER | DIGIT | '.' | '-' | '_' | ':' QUOTE ::= '"' START ::= LETTER | '_' TOKEN_AND ::= 'and' TOKEN_ASTERISK ::= '*' TOKEN_ATRATE ::= '@ ' TOKEN_COMMA ::= ',' TOKEN_DOUBLESLASH ::= '//' TOKEN_EQUAL ::= '=' TOKEN_GREATERTHAN ::= '>' TOKEN_GREATERTHANEQUAL ::= '>=' TOKEN_INTERSECT ::= 'intersect' TOKEN_LESSTHAN ::= '<' TOKEN_LESSTHANEQUAL ::= '<=' TOKEN_LPAREN ::= '(' TOKEN_LSQUARE ::= '[' TOKEN_MINUS ::= '-' TOKEN_NOT ::= 'not' TOKEN_NOTEQUAL ::= '!=' TOKEN_OR ::= 'or' TOKEN_PERIOD ::= '.' TOKEN_PLUS ::= '+' TOKEN_RPAREN ::= ')' TOKEN_RSQUARE ::= ']' TOKEN_SLASH ::= '/' TOKEN_TO ::= 'to ' TOKEN_UNION ::= '|' | 'union' TOKEN_ID ::= START [NONSTART...] TOKEN_FLOATVAL ::= DIGITS | '.'DIGITS | DIGITS'.'DIGITS TOKEN_INT ::= DIGITS TOKEN_STRING ::= QUOTE NONQUOTE... QUOTE | APOS NONAPOS... APOS TOKEN_TEXT ::= 'text'