Archives: XML

Java – Read XML File – SAX Parser

SAX Parser is faster and uses less memory than DOM parser.
file.xml

ReadXMLFile.java


Java – Read XML File – DOM Parser

File.xml

ReadXMLFile.java

Output:

Root element :company
———————–
First Name : prasanna
Last Name : sherekar
Nick Name : pashyaa
Salary : 500000
First Name : james
Last Name : anderson
Nick Name : james
Salary : 200000