Whitespace in XQuery 1.0

We are trying to validate our understanding of the XQuery lexical productions.  After reviewing the XQuery spec I've come the conclusion that it is very flexible on the use of whitespace. Two designations, explicit and significant, may be assigned to productions. Explicit states that any whitespace allowed in the production must be stated. Significant states that whitespace is allowed and must not be discarded.

The end result is that for everything else "whitespace may freely be added between terminals..." but it is apparently not required. In addition, the preference in lexical analysis is for the longest possible valid match.

So... the following would appear to be a valid xquery expression:

for$x in document("foo")/item stableorderby$x/size return$x

because

1) There is no requirement for whitespace between keywords and variable references
2) stableorderby can be represented by the grouing of terminals denoted by < "stable" "order" "by"> which again has no requirement for whitespace between terminals.

So our questions are (1) is this correct?  and (2) is this what people expected?

Kevin Jones

Received on Tuesday, 2 September 2003 15:50:01 UTC