[jdom-interest] SAXOutputter

Laurent Bihanic laurent.bihanic at atosorigin.com
Tue Apr 20 10:24:29 PDT 2004

Bradley S. Huffman wrote:
> JDOM already has SAXOutputter.output(List) for outputing fragments. I
> don't think Chris's use case is a common enough one to warrent another
> method that does basically the same thing as a existing one. Plus, there
> is a workaround. But given a choice, I'd rather see the behaviour of
> output(List)/output(Content) changed than the two outputFragment methods
> added.

The output() methods output a (set of) node(s) as a document (i.e. firing the 
start/endDocument events) while the outputFragment() methods only output a set 
of SAX events, letting the user to manage higher level events 
(start/endDocument & enclosing start/endElement events).

I don't think changing the behaviour of the output(List) method is a good idea 
since it's probably already used by existing code.
For instance, JDOMSource uses it to output nodes lists to XSLT processors, 
expecting start/endDocument events to be fired. Same for the schema validator 
(org.jdom.contrib.schema.Schema) to output node lists to JARV


More information about the jdom-interest mailing list