Converting a org.jdom DOC to org.w3c DOC

Praveen Chhangani

Usenet Archive
Joined
Aug 5, 2003
Messages
3
Reaction score
0
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
 

Johannes Koch

Usenet Archive
Joined
Nov 14, 2000
Messages
801
Reaction score
0
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);
 

Praveen Chhangani

Usenet Archive
Joined
Aug 5, 2003
Messages
3
Reaction score
0
Johannes Koch wrote:
Praveen Chhangani wrote:
> 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.

...

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.

Praveen
 

Johannes Koch

Usenet Archive
Joined
Nov 14, 2000
Messages
801
Reaction score
0
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
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top