Re: [xml] python wrapper for xslt document API: context problem; __cmp__ needed?

Nic James Ferrier <nferrier tapsellferrier co uk> writes:

So I think I probably need the stylesheet to implement the Python
comparator interface. 

A naive implementation would be in C and would test that the libxslt
stylesheet struct was the same instance. That would do for me.

I've been looking at this more. Here's the steps (I think)

- add a libxslt_xsltCompare(PyObject *a, PyObject *b)

- add python API for the above (alter libxslt-python-api.xml)

- add a new class in xsltCore with a __cmp__ or an __eq__
  that calls libxslt_xsltCompare

- change's classes_ancestor map to include stylesheet and
  transformCtxt as xsltCore objects

I'm still unclear as to how libxslt_xsltCompare might work generically
for stylesheet and transformCtxt objects. It might be that I need 2
different parent classes just to perform this trick.

Someone (Daniel?) verify this isn't mad?

Nic Ferrier   for all your tapsell ferrier needs

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