[XQuery]&[XPath] Different StringLiteral Definition in XPath 2.0 and XQuery 1.0

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

Received on Thursday, 26 August 2004 06:38:36 UTC