views:

24

answers:

2

Hi!
I'm trying to use XmlHandler class ( link to Forum Nokia with code of XmlHandler Class ) on Symbian S60 3rd FP2 edition to read xml files. I have in my function this code:

CXmlHandler *iXmlHandler;
TFileName fileName;

iXmlHandler = CXmlHandler::NewL();
fileName.Append( KConfigFile );
iXmlHandler->StartParsingWithAoL( fileName );

But I don't know how to use data from KConfigFile...
Can anybody tell me how I can read nodes from my XML file and use data from nodes?

A: 

That example is a normal complete SAX parser. You get your nodes as callbacks, so you need to add your logic to OnStartElementL.

Teknolog
Can you tell me more about code in OnStartElementL?What exactly I need to write in this function (cause I don't understand word 'logic' in this sentense)?
Marek
You need to write the code to handle the tag in whichever way you want to. Compare the tag name to the tag you're looking for and handle parameters accordingly.
Teknolog
A: 

You need to add code to the various OnStart* and OnEnd* member functions. The parser will call these functions in order as it proceeds through the file. The arguments to the functions will contain the information about what tag is opening and closing. If you want to store any of the parsed information it is up to you to do so in these functions.

Ola