views:

49

answers:

1

I need to transform a XML. Usually I would use Saxon and a XSLT 2.0 stylehsheet for this. The transformations I have to do involve side-effects and are stateful and manipulate the contens of nodes, so implementing a XPath function doesn't make that much sense.

I decided to implement a transformer class for this purpose. I found javax.xml.transform provides a standard interface for this, but is targeted towards implementing a XSLT processor (it requires a TransformerFactory and Transformer for each transformation) and seems complex and unnecessary for my purpose.

Is there a general XML (DOM) transformation interface which I could use instead of inventing my own?

A: 

The javax.xml.transform interface is the standard means in Java for performing an XSLT transform on an XML document. Since it does not appear that your transform will be XSLT based, this is not the correct API for you.

Programmers occassionally implement their own versions of Source and Result to hook into standard javax.xml.transform transformers, but this is not your use case.

Is there a particular API you are hoping to integrate with? If not you will be better off desigining your own API.

Blaise Doughan
No, I don't want to integrate with something specific, but I just wanted to make sure that there's nothing I'm missing.
ott
Blaise Doughan