Regarding xml parsing. | developer.brewmp.com Regarding xml parsing. | developer.brewmp.com

Developer

Regarding xml parsing.

Forums:

Hi, all
I am developing an application, which uses the rexian parser for parsing xml file.The problem is that, application working fine in the simulator but when I loaded my application in device(moto v3c) the device resets.I have loaded the xmlparser extension in the device.

I am posting the code and the output window when it runs in simulator also the brew logger window when it runs in device.
please take a look on it...
(the xml file is also in the device)

void gmttimer_parseXmlData(gmttimer *pMe)
{
if(ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_FILEMGR,(void**)&pMe->gmtXmlFileMgr)==SUCCESS)
{
pMe->gmtXmlFile=NULL;

pMe->gmtXmlFile=IFILEMGR_OpenFile(pMe->gmtXmlFileMgr,"gmttimer.xml",_OFM_READ);
IXMLPARSER_SetUserData(pMe->gmtXmlParser,pMe);
IXMLPARSER_SetStartElementHandler(pMe->gmtXmlParser,gmttimer_startElement);
IXMLPARSER_SetCharactersHandler(pMe->gmtXmlParser,gmttimer_startCharacter);
DBGPRINTF("Parsing file...................started");
IXMLPARSER_ParseFile(pMe->gmtXmlParser,pMe->gmtXmlFile);
DBGPRINTF("Parsing end......................");
}
else
DBGPRINTF("File not open........................");

void gmttimer_startElement(gmttimer *pMe,const AECHAR* lpszNameSpaceURI,const AECHAR* lpsxLocalName,const AECHAR* lpszQName,ISAXAttributes *pAttr)
{
WSTRTOSTR(lpsxLocalName,pMe->node,20);
DBGPRINTF("Getting start element.............:");

void gmttimer_startCharacter(gmttimer *pMe,const AECHAR* lpszChars,int16 nLen)
{

if(STRCMP(pMe->node,"country")==0)
{
if(pMe->countryid%2==0)
{
pMe->countryName[pMe->countryCount]=(AECHAR*)MALLOC(nLen*sizeof(AECHAR));
WSTRLCAT(pMe->countryName[pMe->countryCount],lpszChars,(nLen+sizeof(AECHAR)));
pMe->countryCount++;
DBGPRINTF("Getting start character..............");
}
pMe->countryid++;
}
else if(STRCMP(pMe->node,"offset")==0)
{
if(pMe->offsetid%3==0)
{
pMe->offSet[pMe->offsetCount]=(AECHAR*)MALLOC(nLen*sizeof(AECHAR));
WSTRLCAT(pMe->offSet[pMe->offsetCount],lpszChars,(nLen+sizeof(AECHAR)));
pMe->offsetCount++;
DBGPRINTF("Getting offset...................");
}
pMe->offsetid++;
}

}

and the output/debug window
*gmttimer.c:85 - 2.In EVTAPPSTART...................
*gmttimerextra.:28 - 3.going to parse...............
*gmttimerextra.:297 - Parsing file...................started
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:320 - Getting start character..............
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:331 - Getting offset...................
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:320 - Getting start character..............
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:331 - Getting offset...................
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:320 - Getting start character..............
*gmttimerextra.:307 - Getting start element.............:
*gmttimerextra.:331 - Getting offset...................

continue....till the xml file parserd(depends on the nodes of the xml file)

but when I execute application on device, it runs on only one time. the logger output is:

12/16/08 13:34:48.281029 WakeAppStart -> NEW HISTORY *AEEShell.c 7229 3
12/16/08 13:34:48.281609 #*gST=624177444 *AEEShell.c 6801 3
12/16/08 13:34:48.283928 App_SendStart(0)... *AEEShell.c 9174 3
12/16/08 13:34:48.284355 2.In EVTAPPSTART................... *gmttimer.c 85 3
12/16/08 13:34:48.300286 #*g*C=101402c:3 *AEEShell.c 6496 3
12/16/08 13:34:48.301659 #*g*C=101402d:3 *AEEShell.c 6496 3
12/16/08 13:34:48.302819 #*g*C=101402e:3 *AEEShell.c 6496 3
12/16/08 13:34:48.338556 3.going to parse............... *GMTTIM~1.c 28 3
12/16/08 13:34:48.344293 Parsing file...................started *GMTTIM~1.c 297 3
12/16/08 13:34:48.359034 Getting start element.............: *GMTTIM~1.c 310 3
12/16/08 13:34:48.366022 Getting start element.............: *GMTTIM~1.c 310 3
12/16/08 13:34:48.374720 Getting start element.............: *GMTTIM~1.c 310 3
12/16/08 13:34:48.378840 Getting start character.............. *GMTTIM~1.c 323 3
12/16/08 13:34:48.390193 Getting start element.............: *GMTTIM~1.c 310 3
12/16/08 13:34:48.392909 Getting offset................... *GMTTIM~1.c 334 3

please take a look on it, and give some suggestions to how to resolve the problem.