[jdom-interest] DOMOutputter output-methods question!

Ralf Lorenz ralf.lorenz at subsist.de
Wed May 15 07:00:32 PDT 2002


Hello,
I'm new to XML and JDOM but trying to get involved.
I'm using JDOM to read in configuration files and then initialize log4j(1.1.3) with the root element of one of these files.
When I use 

DOMOutputter domOutputter = new DOMOutputter
                                         (Constants.DEFAULT_DOM_ADAPTER_CLASS);
org.w3c.dom.Element element = domOutputter.output(document.getRootElement());
DOMConfigurator.configure(element);

I'll get a configuration-error from log4j but when I instead use 

org.w3c.dom.Document doc = domOutputter.output(document);
DOMConfigurator.configure(doc.getDocumentElement());

then everything works fine.
I even tried to print me out the JDOM-generated org.w3c.dom.Element but that didn't work out because I couldn't append this to
an org.w3c.dom.Document with the error: (using Xerces that means DocumentImpl)

org.w3c.dom.DOMException: DOM005 Wrong document
        at org.apache.xerces.dom.ParentNode.internalInsertBefore(ParentNode.java:390)
        at org.apache.xerces.dom.ParentNode.insertBefore(ParentNode.java:322)
        at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:387)
        at org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java:228)
        at de.subsist.zeiterfassung.configuration.XMLLogConfiguration.outputElement(XMLLogConfiguration.java:78)
        at de.subsist.zeiterfassung.configuration.XMLLogConfiguration.initializeLogging(XMLLogConfiguration.java:65)
        at de.subsist.zeiterfassung.configuration.XMLConfiguration.initLogging(XMLConfiguration.java:65)
        at de.subsist.zeiterfassung.InitMain.main(InitMain.java:59)
Exception in thread "main" 

As I said I'm new to that but I've seen a little discussion about the method : 
    org.w3c.dom.Element DOMOutputter.output(org.jdom.Element element) 
and so I just want to know what I've done wrong and what about this methods!
cheers

Ralf Lorenz
____________________________

subsist GmbH
Gautschweg 2
01309 Dresden
Tel.  +49 351 315 65 55
Fax. +49 351 315 65 50
http://www.subsist.de
http://palm.subsist.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20020515/12640992/attachment.htm


More information about the jdom-interest mailing list