[XML-SIG] XPath in Python 2

Paul Prescod paul@prescod.net
Mon, 10 Jul 2000 16:27:40 -0500


Uche Ogbuji wrote:
> 
> ..
>
> > 4XPath is cleaner from a user's point of view, but it requires a lot bit
> > of C/lex code for parsing the XPaths. I don't know if we would have to
> > go back to the BDFL to get permission for that code to go into Python.
> 
> Would it be good enough for us just to check in ANSI C code from FLEX/Bison?

I'm not sure that Guido would go for that because it means that everyone
must go back to you for changes, right?
 
> I don't know.  I agree that most people don't need XPath's zoo of axes, but I
> think predicates would be sorely missed very quickly.

It depends on the target audience. You seldom miss what you've never
used and most Python users have never used XPath or XSLT. Anyhow, the
more important point is that much of what predicates do could be done in
Python code. For you and I, that would grate, but if you compare it to
what they've got now (even in DOM, Pyxie, qp_xml, etc.) it's not like
they are losing something.

Positional and attribute existence qualifiers are easy. I could
implement those. I just don't want to get dragged into implementing the
full expression language!
 
> I should note that other benefits of the mini-xpath -> 4XPath migration would
> be indexing and extension functions.

Totally. I would expect to use 4XPath for my personal work and in fact
I've designed the module so that it can detect and use other XPath
engines, especially those that may be tightly integrated with a
particular DOM implementation.
-- 
 Paul Prescod - Not encumbered by corporate consensus
"Computer Associates is expected to come in with better than expected 
earnings." Bob O'Brien, quoted in
	- http://www.fool.com/news/2000/foth000316.htm