[jdom-interest] Question about JDOMResult and usage with XMLReader
laurent.bihanic at atosorigin.com
Tue Jul 30 00:59:39 PDT 2002
The SAXException "Ill-formed XML document (multiple root elements detected)"
is thrown whenever SAXHandler (used by JDOMResult and SAXHandler) is
processing data that should be added to the current element but no current
This usually signals a bug in an XSLT stylesheet which leads the XSLT
processor to generate documents with several root elements or with text or
CDATA sections directly at document level.
Mario Felarca wrote:
> Hello all,
> I have searched the archives, and have also compiled my own jar from the
> latest tree, but I am experiencing some weird behavior and I was hoping
> someone else may know what is causing this problem.
> I have some code that is transforming data. I have an XMLReader that is
> setting an ContentHandler from a templates object as its content
> handler. The handler to that is being set as one of two things (since I
> was testing both).
> The first case, which doesn't work, is when I do the following.
> JDOMResult jdr = new JDOMResult();
> Where current is the content handler for a templates object and reader
> is the XMLReader.
> This throws me the following exception on the reader.parse line.
> java.lang.RuntimeException: org.xml.sax.SAXException: Ill-formed XML
> document (multiple root elements detected)
More information about the jdom-interest