×

Discussion Board

Results 1 to 14 of 14

Thread: Xml parsing

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    57

    Xml parsing

    Hello,
    I want to parse the xml having this code

    <buyer-list>
    <buyer>
    <name>abc</name>
    <address>
    <city>pune</city>
    <zip>2100</zip>
    </address>
    <phone>333.33.33</phone>
    <fax>333.33.33</fax>
    <email>abc@mail.com</email>

    </buyer>

    </buyer-list>
    How can i do this.Please tell me if anyone knows about it .

    thanks
    Cheers...
    Sunil W.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Xml parsing

    Hi,

    Have you seen this article?

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: Xml parsing

    Hi,

    Look for the DOM xml parser in wiki.

    Regards,
    Kavit.

  4. #4
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Pune, India
    Posts
    94

    Re: Xml parsing

    Hi sunilw,

    For parsing your xml code, you can use the CParser and MContentHandler classes.

    Look at their documentation in the sdk for help.
    Regards,
    Amey

  5. #5
    Registered User
    Join Date
    May 2007
    Posts
    57

    Strange Problem with xml Parsing

    Hi,
    Thanks for all of your reply.I have used cparsar but while parsing i got the error at this character & .what will be problem.

    thanks,
    Cheers...
    Sunil W.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Strange Problem with xml Parsing

    Remember that & has a special role in XML (as it also has in HTML). Try &amp;

  7. #7
    Registered User
    Join Date
    May 2007
    Posts
    57

    Xml parsing

    Hi wizard_hu_,

    Thanks for the reply.can we get the value of each tag?I Want to get the value of each tag separately.let say if this is a tag <name>abc</name>.i want to get the value abc.



    thanks,
    Cheers...
    Sunil W.

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Xml parsing

    You already get the content of each tag separately. That is how CParser works...

  9. #9
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Pune, India
    Posts
    94

    Re: Xml parsing

    Hi SunilW,

    Look at sdk help for OnContentL() method inside MContentHandler
    class.
    Hope this helps.
    Regards,
    Amey

  10. #10
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Xml parsing

    Hi sunilw,

    First parameter of OnContentL()(derived from MContentHandler) contain your "abc".

  11. #11
    Registered User
    Join Date
    May 2007
    Posts
    57

    Re: Xml parsing

    hi all,

    Thanks very much for help.I got the content.
    Cheers...
    Sunil W.

  12. #12
    Registered User
    Join Date
    May 2007
    Posts
    57

    Re: Xml parsing

    [ TInt fileLen;
    TLex lex(data);
    TUint32 iResult;
    TInt Err = lex.Val(iResult, EDecimal);
    return iResult;
    Cheers...
    Sunil W.

  13. #13
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Xml parsing

    Quote Originally Posted by sunilw View Post
    [ TInt fileLen;
    TLex lex(data);
    TUint32 iResult;
    TInt Err = lex.Val(iResult, EDecimal);
    return iResult;
    was that a wrong post ?

  14. #14
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,537

    Re: Xml parsing

    Nice to see that the thread owner wanted to make sure that he continues to work on this even after a couple of years!!

Similar Threads

  1. Parsing wbxml file to xml file using kxml parser
    By ramyashashe in forum Mobile Java General
    Replies: 18
    Last Post: 2010-05-17, 15:56
  2. Parsing xml data from the server using kxml2 in J2ME
    By dninsiima in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2010-03-26, 08:08
  3. Replies: 12
    Last Post: 2010-03-21, 19:25
  4. Need knowledge about XML and XML Parsing
    By 02060515 in forum Mobile Java General
    Replies: 1
    Last Post: 2008-07-07, 08:41
  5. XML Parsing
    By jessyjane in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-04-24, 08:17

Posting Permissions

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