This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: FXPath - A comment on EXSL


Hi David,

>> With the keywords in IfExpr and Reduction, I wonder whether it
>> would be a little easier for implementors and authors if they were
>> given names that absolutely could not be element names? All that
>> would involve is adding a '#' at the beginning of each of them. For
>> example, if I had an element that was called 'reduce' then this
>> would currently be mistaken for the keyword and presumably give an
>> error. If you don't make this change, perhaps some words on
>> tokenisation might be in order, as there are in the XPath Rec
>> (http://www.w3.org/TR/xpath#exprlex).
>
> Yes, tokenisation should be mentioned. If I've not overlooked
> something, the FXPath grammar can be parsed with a single token
> lookahead. This is what's currently needed for XPath 1.0.

After wracking my brains all night (see what I mean about life and
XML?) I thought of one! :)

   if and then * else - 2

Could be:

  if (and) then (*) else (- 2)

or:

  (if) and (then) * (else - 2)

I think that having any of the operators that could be names - e.g.
and, or, mod, div, * - as the 'test' for the if means that you can't
use single-token lookahead, but the above shows that even if you have
the entire expression sometimes you can't tell.

Of course the other option would be to use symbols rather than
keywords, e.g.:

  and ? * ! - 2

(which could even be and?*!-2 without ambiguity, I think).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]