Re: [xml] PATCH: XPOINTER and friends

On Fri, Sep 29, 2006 at 05:39:08PM -0500, Ross J. Reedstrom wrote:
Daniel and all:


 I finally had time to work on it.

I'm writing on behalf of Brian West, Stefan Anca and myself.  By merging
all our brains, we've come up with a candidate implementation of python
We've choosen to represent a POINT as a tuple of a node and an integer
offset into the content of the node. A RANGE then is a list of POINTs,
and a LOCATIONSET is a list of RANGEs.

I've attached a diff against CVS head (from repository at ), with new files as separate

  The patch looks just fine to me, I applied it and commited it to CVS,
thanks a lot !

There's a bit of impedance mis-match between xpointer's 1 based offsets
to points between characters, and python 0 based indexes into character
array-like strings. We chose not to attempt to adjust those.

The final hurdle was to fixup xpathObjectRet() to not assume any list
was a list of nodes (since we've got ints in there as well). This did
cause one change in the API from the python side: previously, tuples of 
nodes were returned as a list. We preserve the tupleness of those now.
Looks like all other uses of python tuples are in error handlers or as
arguments to PyEval: none were passed to xpathObjectRet.

A student working with us even coded up some tests, which I've attached
as well: they need to be dropped in python/tests. They may need fixing
up to match your test machinery. Right now, they're a bit chatty.

  Right the test as is can't really be commited since it breaks the no output
assumption of 'make tests' in python. Basically the python code would have
to embbed the logic of checking the output, instead of relying on the user
to garantee it's correct (and honnestly it's really not trivial). Can you
please fix to work that way and send it back ?
I also had to roll back the python/test/ change to not reference since I can't commit it as is.

  thanks !

  thanks !


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]