Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML parsing procedure

 
avaya c
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using xml4j_3_0_1 parser. I have gone through the samples of
DOMCOunt,DOMWriter etc using
c>> java dom.DOMWriter data\personal.xml
But what is the procedure if i have my own abcd.xml,abcd.dtd and
a small program GetParseTree.java which calls the parser and gives me the dom tree reference.
Please help...fighting with this since three days.
- Thanks in advance.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been using the Sun JAXP parser so I don't know about the XML4J parser, but it should have come with at least one example of a program to create a parser and read in an XML file.
It can really be rather simple.
input = Resolver.createInputSource( df );
try {
doc = XmlDocument.createXmlDocument (input, false);
}catch( SAXException se ){
System.out.println("createXmlDocument threw " + se );
}
But the exact classes depend on the parser package.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic