haven't explained what the "new DocumentSource()" does - is DocumentSource a
subclass of DOMSource?
doesn't accept a DOM Node (from a non-Saxon DOM implementation) as a parameter.
In 7.1 you can achieve this, but you must first wrap it in a DOMSource object.
In 6.x it's not supported at all. One way around this is to supply an invented
URI instead, and then access the document using the document() function,
intercepting the invented URI with your own URIResolver.
really, constructing a DOM simply in order to provide input to Saxon is very
inefficient. Saxon's handling of DOM input is inefficient because DOM doesn't
support things like sorting nodes into document order. So generating a DOM just
so that you can pass it to Saxon is bad news. Generating a SAX stream, or a
Saxon TinyTree, would be far better, even serializing to raw XML might be
I'm using dom4j
and Saxon. I need to pass node set parameters to the transform, and
I'm having a hard time figuring out the API to do this. Here's what I
org.dom4j.io.DOMWriter writer = new
org.w3c.dom.Document domDoc =
factory = TransformerFactory.newInstance();
transformer = factory.newTransformer(new
doesn't seem to see the parameter document. Does anyone have any
examples/hints/suggestions for me? Any other example code of passing
parameters to a transform would be helpful. Any insight into how Saxon
handles parameters would be nice.