RE: [xsl] XPath 1.0 issue

Subject: RE: [xsl] XPath 1.0 issue
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 15 Feb 2005 14:37:21 -0000
'(' and ')' appear as separate terminals in the grammar, therefore a space
is allowed between them. (They are listed separately in this production
rule, and also in the list of ExprToken symbols in rule [28].) If the
grammar had been written as '()' (compare production [5] which uses '::',
and production [12] which uses '..') then no space would be permitted.

It's the fact that VariableReference ('$' QName) is an ExprToken that
ensures no space is allowed after the '$'. The rule is "Whitespace may be
freely added before or after any ExprToken", and by implication, not within
an ExprToken; the definition of ExprToken is in the following section.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Jack Matheson [mailto:jack@xxxxxxxxxxxxxx] 
> Sent: 15 February 2005 13:55
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] XPath 1.0 issue
> 
> Xalan and Saxon both allow an arbitrary number of space characters 
> between the parenthesis in a node test, and I was
> wondering if this is technically legal in XPath 1.0.
> 
> An example would be:
> <xsl:apply-templates select="node(      )"/>
> 
> The XPath TR specifically states that whitespace can exist between 
> tokens, but I'm not exactly sure how "token" is defined after reading 
> the recent thread concerning "$       varname".
> 
> A node test in the XPath TR is defined as:
> 
> [7]      NodeTest   ::=  NameTest
>                                    | NodeType '(' ')'
>                                    | 'processing-instruction' '(' 
> Literal ')'
> 
> Can anyone explain this to me?

Current Thread