| Author |
[#document: null] as a result of parsing
|
mars76
Ranch Hand
Joined: Nov 30, 2000
Posts: 30
|
|
Hi All , I am trying to parse an XML File using DOMParser . The version of xerces i am using is 1.1.3 (One comes with WAS3.5) When i tried parsing a file I got the Document as [#document: null] ================================================================ DocumentBuilderFactory docbuilderfact= DocumentBuilderFactory.newInstance(); DocumentBuilder documentbuilder = docbuilderfact.newDocumentBuilder(); System.out.println("xmlURL......:" + xmlConfigFile); Document document = documentbuilder.parse(xmlConfigFile); System.out.println("Document="+document); ============================================== Pls let me know how to resolve this.. Thanks in Advance Sateesh
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12269
|
|
Thats exactly what you should get. See the JavaDocs documentation for org.w3c.dom.Node - there is a nice table that shows the nodeName and nodeValue for all the different types of node. For a Document, the node Name is #document and the nodeValue is null. You should now be able to do: Element root = document.getDocumentElement(); to get the root element of the document. Bill
|
Java Resources at www.wbrogden.com
|
 |
 |
|
|
subject: [#document: null] as a result of parsing
|
|
|