Can you walk us through the steps necessary to parse XML
documents?

Answer Posted / chandrasekhar

1.create a instance of DocumentBuilderFactory Object using
newInstance() method.
2.get reference to DocumentBuilder object using
newDocumentBuilder() method of DocumentBuilderFactory.
3.get reference to Document object of the xml file to be
parsed by using DocumentBuilder.parse(File xmlfile) with
File object as argument.
start using Document object to get the elements of the xml
file using getElementsByTagName(),getElementsByName()

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better xml or html?

443


Why do we need dtd?

472


Is xml meant to replace html?

496


What are the steps required to render all the xml documents to html on server?

445


How do I identify the document type of an xml document?

558






How do I open an rss feed?

453


What is xml document?

468


Is it possible to use graphics in xml?

495


What is the advantage of automated testing over manual testing?

481


What is xsl format?

464


What are the parts in which template gets defined?

495


Can you use the xslt to convert html into vxml? : xslt

507


What are the different kinds of tags available in XML?

533


What is the stylesheet structure used with xslt?

509


How do I make an xml file readable?

506