xsl-list
[Top] [All Lists]

Re: XPath 1.0 issue

2005-02-15 14:32:42
Thanks again!

'(' 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(_at_)snazzypost(_dot_)com] Sent: 15 February 2005 13:55
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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?







--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>