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

Elliotte Rusty Harold elharo at metalab.unc.edu
Mon Aug 19 05:39:18 PDT 2002

At 11:52 AM +0200 8/19/02, Laurent Bihanic wrote:

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

But it shouldn't be doing that! An XSLT transformation can produce a 
document fragment. JDOM's representation of a document fragment is a 
java.util.List containing various Text, Element, Comment, and 
ProcessingInstruction objects. JDOMResult should be based on such a 
List rather than on a Document. The design of JDOMResult is simply 
not consistent with XSLT or TrAX.

| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |

More information about the jdom-interest mailing list