aspose file tools
The moose likes XML and Related Technologies and the fly likes [#document: null] as a result of parsing Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "[#document: null] as a result of parsing" Watch "[#document: null] as a result of parsing" New topic
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
    
    1
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: [#document: null] as a result of parsing
 
Similar Threads
parsing problem in JBoss
Validating xml against dtd
parsing problem , in JBoss
Help loading XML config file?
How to get xml parser for J2ME application...