Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Converting a org.jdom DOC to org.w3c DOC

Reply
Thread Tools

Converting a org.jdom DOC to org.w3c DOC

 
 
Praveen Chhangani
Guest
Posts: n/a
 
      08-05-2003
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
 
Reply With Quote
 
 
 
 
Johannes Koch
Guest
Posts: n/a
 
      08-06-2003
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.

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

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

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

 
Reply With Quote
 
 
 
 
Johannes Koch
Guest
Posts: n/a
 
      08-07-2003
Praveen Chhangani wrote:
>
> 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.

> Johannes Koch <(E-Mail Removed)> wrote in message

news:<bgqdcl$qpu38$(E-Mail Removed)-berlin.de>...
>>import org.jdom.output.DOMOutputter;
>>import org.jdom.Document;
>>
>>DOMOutputter outputter = new DOMOutputter();
>>org.w3c.dom.Document document =
>> outputter.output(Document jdocument);

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can pydoc display doc for local funcs? or other doc tools for owncode News123 Python 0 02-06-2010 12:31 AM
.pdf doc to word doc PWB Computer Support 14 09-19-2008 10:41 PM
cannot I search the doc's contents (doc=file.read) one more times? shaobo.li@gmail.com Ruby 0 01-11-2005 09:18 AM
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
Parsing MS Word client doc into server-side doc... John Wallace ASP .Net 0 07-22-2003 06:49 PM



Advertisments