[XQuery]&[XPath] Different StringLiteral Definition in XPath 2.0 and XQuery 1.0
"Kirmse, Daniel" <[email protected]> Thu, 26 Aug 2004 08:37:53 +0200
| Newsgroups | gmane.comp.web.query-languages |
|---|---|
| Message-ID | <[email protected]> |
Hi,
is there a reason for the StringLiteral to be defined differently in XPath2.0 and XQuery1.0?
XQuery:
[134] StringLiteral <http://www.w3.org/TR/xquery/> ::= ('"' (PredefinedEntityRef <http://www.w3.org/TR/xquery/> | CharRef <http://www.w3.org/TR/xquery/> | ('"' '"') | [^"&])* '"') | ("'" (PredefinedEntityRef <http://www.w3.org/TR/xquery/> | CharRef <http://www.w3.org/TR/xquery/> | ("'" "'") | [^'&])* "'")
XPath:
[73] StringLiteral <http://www.w3.org/TR/xpath20/> ::= ('"' (('"' '"') | [^"])* '"') | ("'" (("'" "'") | [^'])* "'")
If I do interpret these rules correctly XPath StringLiterals may contain a single '&' XQuery StringLiterals must not contain such a single '&'.
Assuming a string literal according to XQuery[134]
"string that contains a single & character"
and an expression (that is equally defined in both grammars (XQuery[119], XPath[58])
processing-instruction("string that contains a single & character")
For XQuery 1.0 this would a syntax error, for XPath 2.0 this would be perfectly correct. How's this fitting to XPath 2.0 being a subset of XQuery 1.0?
Please advice,
Cheers,
Daniel