Re: Whitespace in XQuery 1.0

Hi Kevin.  Yes, there should be a third category, or maybe two more 
specific categories:

1) required whitespace, i.e. one or more.  In the XML definition of the 
grammar this is <g:requiredSkip show="no"/>
2) optional whitespace.  In the XML definition of the grammar this is 
<g:optionalSkip/>.

I can only explain this with general rules, which is that "words" must be 
separated by requiredSkip, and punctuation can be optionalSkip.  I will 
try and make this more explicit in the next draft.

-scott

public-qt-comments-request@w3.org wrote on 09/02/2003 01:50:44 PM:

> 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 18:07:14 UTC