wrapping single classes in an extension module

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top