Parsing The XML File Using JDOM Parser in JSP

In this example we show how to work with JDOM parser to parse the xml document. JDOM can read existing XML documents from files, network sockets, strings, or from reader.

Parsing The XML File Using JDOM Parser in JSP

In this example we show how to work with JDOM parser to parse the xml
document. JDOM can read existing XML documents from files, network
sockets, strings, or from reader. JDOM does not has its own native parser. XML
parsing produces an xml parse tree from an XML document. Using the JDOM
packages, it's very simple to work with parsed XML documents.

Working with XML document, use the following from JDOM package:
1. Simply make an object of org.jdom.input.SAXBuilder with no-args
constructor
2. Call the Builder's build() method to build a document object from a
reader, InputStream, URL, File or a String containing a system ID.
3. Navigate the document using the methods of the document class, the Element
class, and the other JDOM classes.