tags:

views:

85

answers:

2
+2  A: 

If the file is huge then you should use any SAX based parser or try LibXML parser.

Raghuram
+4  A: 

There are two types of XML Parsers available:

  • simple ones that read the whole XML file into memory and generate an easy accessible data structure, this takes a rather big amount of memory so you'll get into trouble with bigger files. Their advantage is that they are usually very easy to work with.

  • the SAX based parsers which process the XML element by element. To work with this parsers the developer (you!) has to register callbacks for every interesting element and work with the information from the callbacks. Everytime the SAX parser encounters a given element the associated callback is executed and you are able to only work with the interesting tags rather the whole file at once. This parsers keep the memory usage (potentially) very low but require substatially more work.

tex