This is a great example. I was able to adapt this to my needs, but I don't understand how to extend it to large files. I am trying to parse a file that does not fit into memory. Advice on how to stream the file would be great.
XML is playing an increasingly important role in the exchange of a wide variety of data on the server. Application may request some data from server in form of XML using predefined protocol, Or send data to server in form of XML using predefined protocol. CParser class, which is used to parse XML, is introduced in Symbian from version 8.1a.
CParser is SAX parser. Interface MContentHandler will gives a callback on start of each tag and at the end of tag, which is useful to parse each tags and attribute of XML file. OnStartElementL() get called for each tag, RTagInfo will gives name of tag and RAttributeArray will each attribute and its value. First parameter of method OnContentL() will contains data of tag.
You can use class CXmlHandler, of this article, to parse XML in your application. Source code with article helps to understand how to use CParser, comments in article will be useful to understand importance of each function.
--kamlesh sangani 13:39, 16 September 2009 (UTC)