Converting a org.jdom DOC to org.w3c DOC

  • Thread starter Praveen Chhangani
  • Start date
P

Praveen Chhangani

Folks,

I was wondering if it were possible to convert an org.jdom.doc to an
org.w3c.doc document.

Essentially what I have is an already parsed document using jdom and I
would like to use the document object in another application that is
expecting a DOM (w3c) document.

If someone could perhaps, show me an example that would be very much
appreciated.

Thanks
Praveen
 
J

Johannes Koch

Praveen said:
I was wondering if it were possible to convert an org.jdom.doc to an
org.w3c.doc document.
Yes

Essentially what I have is an already parsed document using jdom and I
would like to use the document object in another application that is
expecting a DOM (w3c) document.

Have a look at the JDOM Javadoc.

import org.jdom.output.DOMOutputter;
import org.jdom.Document;

DOMOutputter outputter = new DOMOutputter();
org.w3c.dom.Document document =
outputter.output(Document jdocument);
 
J

Johannes Koch

Praveen said:
Johannes,

Thanks for the quick response. I have been looking at the JDOM
documentation and so far what I see is conversion from DOM to JDOM,
but what I am really looking for is from JDOM to DOM conversion.

Any ideas, or perhaps an example as to how this is done will be very
much appreciated. Thanks.

Did you really read my post? I included an example for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,798
Messages
2,569,651
Members
45,385
Latest member
ZapGuardianReviews

Latest Threads

Top