S
Stefan Behnel
Hi!
In a project, I'm providing an API that is made up by augmenting XML DOM
elements with tag specific attributes and methods. These actually operate on
the DOM and fulfill the need of making the DOM API more user friendly and
domain specific.
I currently use PyXML/4DOM and I'm considering moving the project to a
different package of XML tools that (in addition to XPath) supports RelaxNG,
XSLT, etc. out-of-the-box. My preferred candidate would be lxml (based on
libxml2, which supports basically all XML standards), but it is backed by
classes written in C, which effectively prohibits my current approach of
sticking methods into objects generated by the parser API (the __slots__ problem).
I guess I'd have to go for a more general wrapper for the XML API that
/replaces/ the respective objects (Elements) by my own subclasses whereever
they may occurr, i.e. as return values of various functions, as content of
containers that are being passed around, etc. This looks like a lot of work to
me...
Therefore my question: Can anyone imagine a simpler way of approaching this
problem? My main interest is to extend the API of XML handling by my domain
specific one to make usable through the same objects.
Thanks in advance,
Stefan
In a project, I'm providing an API that is made up by augmenting XML DOM
elements with tag specific attributes and methods. These actually operate on
the DOM and fulfill the need of making the DOM API more user friendly and
domain specific.
I currently use PyXML/4DOM and I'm considering moving the project to a
different package of XML tools that (in addition to XPath) supports RelaxNG,
XSLT, etc. out-of-the-box. My preferred candidate would be lxml (based on
libxml2, which supports basically all XML standards), but it is backed by
classes written in C, which effectively prohibits my current approach of
sticking methods into objects generated by the parser API (the __slots__ problem).
I guess I'd have to go for a more general wrapper for the XML API that
/replaces/ the respective objects (Elements) by my own subclasses whereever
they may occurr, i.e. as return values of various functions, as content of
containers that are being passed around, etc. This looks like a lot of work to
me...
Therefore my question: Can anyone imagine a simpler way of approaching this
problem? My main interest is to extend the API of XML handling by my domain
specific one to make usable through the same objects.
Thanks in advance,
Stefan