[XML-SIG] PyXPath 1.1

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri, 15 Dec 2000 21:58:59 +0100


> Yes, thanks Martin this saves us a lot of time.  Question, will it
> handle "mod mod mod" or "* * *"?  These needs to translate to the
> token wildcard name, operator, wildcard name.  I ask 'cause this
> caused us many headaches with 4XPath.  We had to do it with flex
> state.

Currently, "* * *" is recognized as NameTest NameTest MultiplyOperator.

This was incorrect due to a minor bug. I just fixed that, it now
tokenizes this as STAR (i.e. NameTest) MultiplyOperator STAR and
NCName mod NCName, respectively.

The scanner generator in yapps was not suitable for the special rules,
so I have my own hand-written parser. For Spark, the "generated"
tokenization could be easily expanded to provide the correct token
sequence.

> > Maybe it's worth designing a plug-in API for XPath implementations
> > so people can make their choices.
> 
> This wouldn't be that difficult.

I think there is no need to have two different XPath tokenizers that
both use sre. Instead, I hope we can merge the two implementations,
using correctness and speed as measurements.

It then still needs to adjusted to the parser, but that is normally a
simple transformation - the underlying code should always be the same.

Regards,
Martin