[jdom-interest] Problem with DocType when converting JDOM Document to (JAXP) W3CDocument

Jason Hunter jhunter at servlets.com
Wed Oct 24 08:40:56 PDT 2001


"Bilton, Sasha" wrote:
> 
> > -----Original Message-----
> > From: Jason Hunter [mailto:jhunter at acm.org]
> >
> > JAXP is a little library that automatically select a parser for you
> > based on system properties.  There's no such thing as a "JAXP
> > Document".  Thus I don't understand your question.
> 
> Sorry my mistake, I have a annoying habit of say JAXP when I mean W3C.
> 
> When we convert,using DOMOutputter, our org.jdom.Document to
> org.w3c.dom.Document (from Crimson.jar) we lose the Doctype information.
> 
> The original jdom.Documnet.getDocType() returns a valid DocType object, but
> we don't see it in the w3c.Document

Well, if you look at the code for DOMOutputter there is code to set it.  

            // Assign DOCTYPE during construction
            DocType dt = document.getDocType();
            domDoc = createDOMDocument(dt);

Are you using the beta7 or later?  Make sure you are.  If it's still not
working, you have the code so you can do a little debugging on why that
setting above isn't working for you.  Let us know what you find.

-jh-



More information about the jdom-interest mailing list