wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes org.w3w.dom.DOM object  to  an org.jdom.DOM object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "org.w3w.dom.DOM object  to  an org.jdom.DOM object" Watch "org.w3w.dom.DOM object  to  an org.jdom.DOM object" New topic
Author

org.w3w.dom.DOM object to an org.jdom.DOM object

Ambrose Tati
Ranch Hand

Joined: Oct 03, 2000
Posts: 55
Dear all,
Can somebody tell me if it's possible to convert an
org.w3w.dom.DOM object to an org.jdom.DOM object?
My application XML Schema validates an XML instance producing
a org.w3w.dom.DOM object. I find it easier to process XML files using JDOM so I was wondering if it's possible to do such conversion?
Many thanks
Ambrose Tati
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Ofcourse! You can use the DomBuilder class to build a JDOM tree using a pre-existing( in memory ) DOM tree.
The class can be used to build from files, streams, etc but other builders like SAXBuilder can perform the task faster because they don't create a DOM tree first
Hope that helps!
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
    
    1
I have to do the same thing, only DOMBuilder takes a DOM Document object. But I don't have a Document object, I only have a Node object.

What is the easiest way to convert a DOM Node into JDOM Element?

Thanks
Geoffrey


Sun Certified Programmer for the Java 2 Platform
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: org.w3w.dom.DOM object to an org.jdom.DOM object
 
Similar Threads
Converting Document Object to String
can we pass object in XML file(urgent)
Deep copy of complicated object
Object Serialization Process?
Java Objects to XML