[xml] Re: libxml driver for PyXML
- From: Dave Kuhlman <dkuhlman cutter rexx com>
- To: Daniel Veillard <daniel veillard com>
- Cc: xml gnome org
- Subject: [xml] Re: libxml driver for PyXML
- Date: Mon, 28 Jan 2002 13:59:21 -0800
On Sat, Jan 26, 2002 at 09:38:22AM +0100, Daniel Veillard wrote:
On Fri, Jan 25, 2002 at 05:14:00PM -0800, Dave Kuhlman wrote:
Daniel -
Keeping you informed ...
I'm working on a parser driver for PyXML. I'm modeling it on the
implementation of pyexpat. It will be a drop-in replacement for
other drivers like pyexpat, sgmlop, xmllib, etc. I'm calling it
pylibxml (not too inventive, but descriptive).
Hum, that's the name I expected to use for the code package
of the official libxml wrapper for python.
Needles to say, you get first rights. And, that particular name is
not that important to me. It was a first name drawn out of a hat,
sort of thing. Other parser drivers, for example, are named:
pyexpat
xmlproc
xmllib
sgmlop
The "op" in "sgmlop" stands for "optimized". So, what about using
"libxmlop" as the name of a SAX driver for PyXML? Other
suggestions?
Below are some notes that I've copied from the pyexpat README and
written to guide myself in this work.
Suggestions and guidance?
As I said in the answer on the list, I didn't yet read the PyXML
stuff. In general I'm not too supportive of using only the SAx level of
libxml because basically it uses only 5% of the features of the library.
Agreed. Still, a parser driver based on libxml might be a valuable
thing. I certainly agree that this should not be the only support
for Python built on libxml.
=========
Questions
=========
How do we implement the callbacks? Answer: Do it the libxml SAX
way -- Create callback table. Fill in function pointers. Look
up and call methods in Python handler instance/class.
The latter IMHO since you want to be able to change the callback
on the fly from the python code.
I don't believe that this can be done with either pyexpat or
sgmlop, the other parser drivers implemented in C. That is, once
the parse has started, you cannot change which Python event
handlers are called. If we offer this capability, and I believe
that we can, then this is another added value that a libxml SAX
driver can offer to users of PyXML.
Daniel
--
Daniel Veillard | Red Hat Network http://redhat.com/products/network/
veillard redhat com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
--
Dave Kuhlman
dkuhlman rexx com
http://www.rexx.com/~dkuhlman
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]