xsl-list
[Top] [All Lists]

RE: XPath Grammar

2003-06-07 09:13:32
I need help about XPath grammar.
In W3C specification a literal is stated as the
following:

[29]    Literal    ::=    '"' [^"]* '"'  
                      | "'" [^']* "'" 


XPath uses the strange convention of mixing BNF and regular expressions
in a single production rule.

A more conventional approach would be either to write this in BNF (using
the "-" operator to mean "except") as

[29]    Literal    ::=    '"' (Char - '"')* '"'  
                      | "'" (Char - "'")* "'" 

or to do the whole thing as a regular expression:

   Literal ::= ("[^"]*"|'[^']*')

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>