Results 1 to 1 of 1
Thread: Building a document from a DOM
-
Building a document from a DOM
Following code snippet converts a DOM to a document.
Java Code:try { // configure the document builder factory DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware( true ); // get a builder to create a DOM document DocumentBuilder domBuilder = factory.newDocumentBuilder(); // parse the damned document org.w3c.dom.Document w3cDocument = domBuilder.parse( "drainpipe.xml" ); // create a JDOM DOM Builder DOMBuilder jdomBuilder = new DOMBuilder(); // create a JDOM Document from a w3c DOM org.jdom.Document jdomDocument = jdomBuilder.build( w3cDocument ); System.out.println( jdomDocument ); } catch( Exception e ) { e.printStackTrace(); }
Similar Threads
-
Problem with String Building
By Albert in forum New To JavaReplies: 2Last Post: 04-30-2012, 12:49 AM -
help needed regarding tree building
By invincible_me in forum New To JavaReplies: 2Last Post: 08-12-2008, 01:44 PM -
building a house
By dc2acgsr99 in forum Java AppletsReplies: 4Last Post: 03-07-2008, 11:18 PM -
Building A Java Project In Eclipse
By JavaForums in forum EclipseReplies: 0Last Post: 05-22-2007, 09:34 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks