×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Parsing file content

    I have file config.txt, and the content file
    <person>
    <name>Hendrawan</name>
    <age>23</age>
    <address>Jl Veteran 79 Jogjakarta</address>
    </person>
    some one can help me, to parse the file, so i get some data
    name = Hendrawan
    age = 23
    address = Jl Veteran 79 Jogjakarta

    Thanks for respon
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  2. #2
    Super Contributor
    Join Date
    May 2005
    Location
    Hyderabad,India
    Posts
    704

    Re: Parsing file content

    Hi,

    Use the syexpat parser. and in CDocumentHandler::StartElement() function like this.

    ->Take a structure with items name,age and address.
    ->Create one array with structure.
    ->In StartElement() function check the tag names and if the tag names are equal to ur structure fields, then assign the values to structure fields. and add the structure to array.

    regards,
    eswar

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: Parsing file content

    Ok I have download syexpat, can you give some information for installing this library for SDK
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  4. #4
    Super Contributor
    Join Date
    May 2005
    Location
    Hyderabad,India
    Posts
    704

    Re: Parsing file content

    Hi,

    After download the syexpat, build the syexpat then it will create syexpat.dll and syexpat.lib. and copy the xmlhelper.h file into sdk include folder. copy the XMLHelper.cpp and XMLHelper.h file into ur application folder and include in the application. And add syexpat.lib in ur libraries.


    regards,
    eswar

  5. #5
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: Parsing file content

    Quote Originally Posted by hendrawan.ashari
    Ok I have download syexpat, can you give some information for installing this library for SDK
    you need to build syexpat.dll and put it in the dll's folder.
    use abld buils winscw udeb if you are using cw as your ide. that would create the .dll and the .lib

    Priju

  6. #6
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: Parsing file content

    Ok thanks i will apply them
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  7. #7
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: Parsing file content

    sorry i have question about syexpat
    i have compile syexpat in code warrior but i get some error.

    Warning : variable / argument 'parser' is not used in function variable / argument 'useDTD' is not used in function
    XMLPARSE.c line 1141
    Warning : illegal implicit conversion from 'XML_Status' to 'XML_Error'
    XMLPARSE.c line 1485
    Warning : illegal implicit conversion from 'XML_Status' to 'XML_Error'
    XMLPARSE.c line 1489
    Warning : illegal implicit conversion from 'XML_Error' to 'XML_Status'
    XMLPARSE.c line 1492
    Warning : illegal implicit conversion from 'XML_Error' to 'XML_Status'
    XMLPARSE.c line 1524
    Warning : illegal implicit conversion from 'XML_Status' to 'XML_Error'
    XMLPARSE.c line 1542
    Warning : illegal implicit conversion from 'XML_Status' to 'XML_Error'
    XMLPARSE.c line 1572
    Warning : illegal implicit conversion from 'XML_Error' to 'XML_Status'
    XMLPARSE.c line 1578
    Warning : illegal implicit conversion from 'XML_Error' to 'XML_Status'
    XMLPARSE.c line 1586
    Warning : illegal implicit conversion from 'XML_Status' to 'XML_Error'
    XMLPARSE.c line 1701
    Warning : illegal implicit conversion from 'XML_Status' to 'XML_Error'
    XMLPARSE.c line 1719
    Warning : illegal implicit conversion from 'XML_Error' to 'XML_Status'
    XMLPARSE.c line 1725
    Warning : illegal implicit conversion from 'XML_Error' to 'XML_Status'
    XMLPARSE.c line 1733
    Warning : variable / argument 'parser' is not used in function variable / argument 'offset' is not used in function
    XMLPARSE.c line 1765
    Warning : variable / argument 'size' is not used in function
    XMLPARSE.c line 1765
    Warning : possible unwanted ';'
    XMLPARSE.c line 2758
    Warning : possible unwanted ';'
    XMLPARSE.c line 2817
    Warning : possible unwanted ';'
    XMLPARSE.c line 4416
    Warning : variable / argument 's' is not used in function variable / argument 'end' is not used in function
    XMLPARSE.c line 4696
    Warning : variable / argument 'nextPtr' is not used in function
    XMLPARSE.c line 4696
    Warning : variable / argument 'ptr' is not used in function variable / argument 'end' is not used in function
    XMLROLE.c line 187
    Warning : variable / argument 'enc' is not used in function
    XMLROLE.c line 187
    Warning : variable / argument 'ptr' is not used in function variable / argument 'end' is not used in function
    XMLROLE.c line 208
    Warning : variable / argument 'enc' is not used in function
    XMLROLE.c line 208
    Warning : variable / argument 'ptr' is not used in function variable / argument 'end' is not used in function
    XMLROLE.c line 256
    ....... has been cut...........
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_ParserFree (__imp__XML_ParserFree)'
    Link Error : referenced from 'CExpatParserBase::~CExpatParserBase(void) (??1CExpatParserBase@@UAE@XZ)' in SYEXPAT.cpp:309
    Link Error : Note: symbol '_XML_ParserFree' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_ParserCreateNS (__imp__XML_ParserCreateNS)'
    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) ?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:321
    Link Error : Note: symbol '_XML_ParserCreateNS' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetReturnNSTriplet (__imp__XML_SetReturnNSTriplet)'
    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) (?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:330
    Link Error : Note: symbol '_XML_SetReturnNSTriplet' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetUserData (__imp__XML_SetUserData)'
    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) ?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:331
    Link Error : Note: symbol '_XML_SetUserData' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetStartElementHandler (__imp__XML_SetStartElementHandler)'
    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) (?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:332
    Link Error : Note: symbol '_XML_SetStartElementHandler' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetEndElementHandler (__imp__XML_SetEndElementHandler)'
    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) (?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:333
    Link Error : Note: symbol '_XML_SetEndElementHandler' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetCharacterDataHandler (__imp__XML_SetCharacterDataHandler)'
    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) (?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:334
    Link Error : Note: symbol '_XML_SetCharacterDataHandler' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetProcessingInstructionHandler (__imp__XML_SetProcessingInstructionHandler)'

    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) (?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:335
    Link Error : Note: symbol '_XML_SetProcessingInstructionHandler' found in 'XMLPARSE.o';
    Link Error : your project may need the DLL import library instead of a static library
    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetCommentHandler (__imp__XML_SetCommentHandler)'
    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) (?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:336
    Link Error : Note: symbol '_XML_SetCommentHandler' found in 'XMLPARSE.o';

    Link Error : your project may need the DLL import library instead of a static library

    Link Error : Undefined symbol: '__declspec(dllimport) _XML_SetStartCdataSectionHandler (__imp__XML_SetStartCdataSectionHandler)'

    Link Error : referenced from 'void CExpatParserBase::BaseConstructL(class TDesC16 const &) (?BaseConstructL@CExpatParserBase@@IAEXABVTDesC16@@@Z)' in SYEXPAT.cpp:337

    Link Error : Note: symbol '_XML_SetStartCdataSectionHandler' found in 'XMLPARSE.o';

    .......... has been cut......................
    Link Error : note: gdi32.lib (default)

    Link Error : note: user32.lib (default)

    Link Error : note: kernel32.lib (default)

    Link Error : Link failed
    i have change structure of syexpat distribution.

    my structure
    +inc
    - expat_config.h
    - SyExpat.h
    - SyGen.h
    - typedefs.h
    +src
    - SyExpat.cpp
    - SyGen.cpp
    +group
    - SyExpat.mmp
    - bld.inf
    +lib
    - All files in lib directory from distribution

    my mmp file.
    TARGET SyExpat.dll
    TARGETTYPE dll
    UID 0x1000008d 0x10204762
    MACRO HAVE_EXPAT_CONFIG_H

    USERINCLUDE ..\inc

    SOURCEPATH ..\lib
    SOURCE xmlparse.c
    SOURCE xmlrole.c
    SOURCE xmltok.c

    SOURCEPATH ..\src
    SOURCE SyExpat.cpp
    SOURCE SyGen.cpp

    SYSTEMINCLUDE \Epoc32\include \epoc32\include\libc ..\lib

    LIBRARY estlib.lib euser.lib

    EXPORTUNFROZEN
    or some one can help me to tell step-by-step how to compile syexpat.
    thanks for response
    Last edited by hendrawan.ashari; 2006-12-08 at 07:50.
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  8. #8
    Super Contributor
    Join Date
    Oct 2005
    Posts
    739

    Re: Parsing file content

    Hi all,

    i am also trying to make syexpat and got the same link error as ashari.

    Do ashari had solved that problem...?

    Will you please give some tips to me on this issue...

    Thanks and regards,
    Peter

Similar Threads

  1. Create MBM file from BMP file.
    By BugBuster in forum Symbian
    Replies: 5
    Last Post: 2003-09-04, 03:25
  2. Replies: 0
    Last Post: 2003-09-02, 17:23
  3. Replies: 0
    Last Post: 2003-09-02, 17:19
  4. Read a content from a file with HTTPConnection on Nokia 7650
    By jota13 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-03-10, 08:26
  5. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×