Warning:
This wiki has been archived and is now read-only.
ITS Simplified XPath
From ITS
Discussion
EBNF for simplified XPath
FullPath ::= RPath | Root | IDPath
SubPath ::= Step* FullTest
RPath ::= '/' SubPath
Root ::= '/'
IDPath ::= 'id(' NCNameStr ')' RPath?
Step ::= StepTest '/' StepTest ::= Name ('[' Num ']')?
FullTest ::= ( (Name | 'text()') ('[' Num ']')? ) | ('@' Name)
NCNameStr ::= "'" NCName "'" | '"' NCName '"'
Num ::= [0-9]+
The above is based on http://www.w3.org/TR/2006/WD-rex-20061013/#path-syntax . Main difference is that it allows for attribute name tests.