[jdom-interest] SAXOutputter

Laurent Bihanic laurent.bihanic at atosorigin.com
Thu Apr 22 02:14:55 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

I don't think this case is so uncommon. I've already encountered it several 
times. My current solution involves an Element proxy class that enables me to 
create a List or Document made of links to elements without detaching those 
from their owning documents.
Quite neat actually (it does not require programmers to know anything about 
SAX) but not possible using only the core JDOM packages.

> 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.

I gave a second thought to output(Content) and I think I'll change it to 
output(Element) as any Content other than Element will lead to ill-formed 
document. Conversely, outputFragment(Content) does not have this issue.

Laurent



More information about the jdom-interest mailing list