XMLTransform enables Zope users to associate an XSLT transformer with an XML document that automatically renders the result of the transformation when called. It can behave like either a Page Template or a DTML Method. There are no constraints on the type of Zope objects used for the XML or XSLT. In fact, the content may cobbled together from multiple sources, as long as the final content may be obtained as well-formed XML from a single object for each.
(See README for more details).
An XMLTransform is a Zope object that links an XML document to a desired XSLT script. The XMLTransform automatically runs the XSLT transformation and renders the results when accessed through DTML or page templates.
An XMLTransform object contains neither the XML source document nor the XSLT transformer. Instead, it obtains each of them from two separate Zope objects, whose IDs are recorded as properties. In this way, an XMLTransform object represents an association between an XML document and a transformer.
This feature differentiates XMLTransform from other XML/XSLT-based Zope products, in that it recognizes the fact that there is often a many to many relationship between XML documents and XSLT transformers.
The XML source pointed to by an XMLTransform can come from anywhere, for example:
Content retrieved from an SQL database and converted to XML format
A DTMLDocument that is an XML file, with portions grabbed from other objects via DTML tags.
An XMLFile instance (XMLFile is part of the XMLKit Zope product)
CVSFile object that points to an external XML document in a CVS repository (CVSFile is part of the CVSFile Zope product)
The only requirement is that Zope object from which XMLTransform obtains the XSLT source must support the __call__() method, and that the resulting XML must be well-formed.
Unfortunately, two well-known Zope products do not support the __call__()
We expect to add the capability to specify an alternate method (for example, __str__() would work in both cases above) to call in a future release of XMLTransform.
In this way, XMLTransform can be used to form "pipelines," where the output of one object becomes the input of the next. This approach is more modular: each kind of object performs only one task, and can be tested and/or replaced on an individual basis.