[jdom-interest] JDOMResult silently absorbs document fragments (was: Re: [jdom-interest] Question about JDOMResult and usage with XMLReader)

Laurent Bihanic laurent.bihanic at atosorigin.com
Mon Aug 19 02:52:06 PDT 2002


manos laliotis wrote:
> I was recently bitten by the same condition, wasting a number of hours 
> before realizing what's the root of the problem. I understand the 
> difficulties mentioned by Laurent and since apparently there's no good 
> solution about them I would suggest to have JDOMResult throw an 
> exception or something when document fragments (-not a full document) 
> are encountered. Currently, in the presence of multiple document 
> fragments, JDOMResult.getDocument() returns only the most 
> recently-encountered fragment, without ever informing the caller that 
> something went wrong.

No, JDOMResult only accepts well-formed documents and do throw an exception 
when it detects multiple root elements.

Laurent




More information about the jdom-interest mailing list