OK, see below:
Here's a use-case for the ProcessorRegistry I
> have in mind:
>
> Somebody writes a new XSLT processor and a class that implements our
> IXSLTProcessor interface in his own party. He would now like to use this
> processor in XSLTMethod. Here is now I would like to see this:
>
> from Products.ZopeXMLMethods.interfaces import IXSLTProcessor
>
> class CustomProcessor:
> __implements__ = IXSLTProcessor
> ...
>
> # processorRegistry is a singleton instance of ProcessorRegistry
> from Products.ZopeXMLMethods.ProcessorRegistry import processorRegistry
> # register sees what interfaces CustomProcessor implements and figures
> # out the rest
> processorRegistry.register(CustomProcessor)
>
OK I am about to check in the XPathMethod initial
implementation. It needs a bit more cleanup,
but it works. Specifically, there are some
duplicated methods that should be factored
out into a utility module somewhere so no
duplication between XSLTMethod.py and XPathMethod.py
Feel free to chisel away at it, if you can
beautify it or simplify. I still need to test
the __reduce__/__getstate__/__setstate__
code to make sure that makes it possible to ZSync
instances to a Zope without the same processor.
I have not tested that yet....
Regards,
--Craeg
|