×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Location
    Bangalore, India
    Posts
    454

    retrieving large amount of data from a XML file

    Hi,

    I want to retrieve data from a XML file.I got good info from this link:

    http://discussion.forum.nokia.com/fo...d.php?t=124199

    but now the problem is : It is fetching the data if XML file contains only one line.

    My data includes almost 100 lines.
    I have tried with 2 lines also...but it is giving error like Error: -991

    Can anyone know about this ?

    Regards,
    Sunitha.M

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: retrieving large amount of data from a XML file

    I have used CParser for parsing my XML file as well and it worked fine.


    study this link carefully:

    http://wiki.forum.nokia.com/index.ph..._CParser_class
    Regards,
    Shafali

  3. #3
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    146

    Re: retrieving large amount of data from a XML file

    I have tried with 2 lines also...but it is giving error like Error: -991
    First, use an XML validator to see if the xml is even valid. Parser will not parse invalid xml (or will report errors which you should handle).

  4. #4
    Regular Contributor
    Join Date
    Aug 2009
    Location
    Bangalore, India
    Posts
    454

    Re: retrieving large amount of data from a XML file

    >> shafalig82
    I have tried with that CParser example only, it works fine if the element doesnot contain Attribute values.
    My xml data seems like :

    <COLUMN NAME="QUESTION"><![CDATA[What is ur Name?]]></COLUMN>
    <COLUMN NAME="ANSWER"><![CDATA[My name is XXXXX]]></COLUMN>

    If I use only 1st line, then I am getting the data on screen.If I add 2nd line also, then it is showing error.

    >> anttijuu

    I am getting this error while installing XMLValidator4UE.

    XMLValidator4UE cannot be installed on the systems with .NET framework version smaller than 1.0

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: retrieving large amount of data from a XML file

    Although the error code is hard to decode using the SDK only, it is possible: check epoc32\include\xml\xmlparsererrors.h. It is probably accessible via the extended list downloadable from http://wiki.forum.nokia.com/index.php/Error_codes
    Anyway, you have EXmlJunkAfterDocElement. Did you know that an XML document consits of a single element, often referred as "document element"? Of course if it is a well-formed one, it also has a processing instruction at the beginning, like <?xml version="1.0"?>, but that is not an element.
    So your current .xml file contains one line of "real" xml, and several lines of garbage, that is why you get the error code.

  6. #6
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    146

    Re: retrieving large amount of data from a XML file


  7. #7
    Regular Contributor
    Join Date
    Aug 2009
    Location
    Bangalore, India
    Posts
    454

    Re: retrieving large amount of data from a XML file

    Hi, My XML is like this.
    >> shafalig82

    You told only one line is correct in my XML, what is wrong here. Please tell me.

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <RESULTS>
    <ROW>
    <COLUMN NAME="ID"><![CDATA[1]]></COLUMN>
    <COLUMN NAME="QUESTION"><![CDATA[What is your Name?]]></COLUMN>
    <COLUMN NAME="ANSWER"><![CDATA[Apple]]></COLUMN>
    <COLUMN NAME="CATEGORY"><![CDATA[Fruit]]></COLUMN>
    <COLUMN NAME="CATID"><![CDATA[1]]></COLUMN>
    </ROW>
    </RESULTS>
    Last edited by sunitha.m13; 2009-09-14 at 06:59.

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

    Re: retrieving large amount of data from a XML file

    Remember that this is the first occasion in this thread where you show that you have a single RESULT element enclosing the whole document. There are people who really put your two lines for #4 into a .xml file and think that it becomes an XML document.
    Otherwise what is the exact location where you get the error code? Which OnXyL of which element?
    Although CDATA is supposed to work, what happens if you do not use it?

  9. #9
    Regular Contributor
    Join Date
    Aug 2009
    Location
    Bangalore, India
    Posts
    454

    Re: retrieving large amount of data from a XML file

    Hi,
    I have removed CDATA, but its not working if XML contains more thatn one line.
    It is not showing the 1st line also, its just displaying Error: -991 (ie. EXmlJunkAfterDocElement)
    How should be the XML doc look like?

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <COLUMN NAME="ID">Apple...</COLUMN>
    <COLUMN NAME="ID">Banana...</COLUMN>

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: retrieving large amount of data from a XML file

    Let us re-interpret my suggestion: put a breakpoint into every method of your MContentHandler. Then check in what order do they get invoked, and which is the one getting the error code (all of them have an aErrorCode argument).
    By the way, if you do not invoke ParseBeginL, you can try if invoking it happens to help.

  11. #11
    Regular Contributor
    Join Date
    Aug 2009
    Location
    Bangalore, India
    Posts
    454

    Re: retrieving large amount of data from a XML file

    Thanks a lot...!!
    Now Iam able to retrieve the data.

    When I am trying to print the name & value of Attribute which is of type TBuf8<> using RDebug. Its not printing correctly.

    <COLUMN NAME="QUESTION"><![CDATA[What is ur name?]]></COLUMN>


    TBuf8<20> name = aAttributes[i].Attribute().LocalName().DesC();
    TBuf8<20> value = aAttributes[i].Value().DesC();
    RDebug::Print( _L("name=%S\n"), &name);
    RDebug::Print( _L("value=%S\n"), &value);

    Output:
    name=NMÌÌ // (NAME)
    value=QETOÌÌÌÌ // (QUESTION)
    Its taking alternate letter.
    Last edited by sunitha.m13; 2009-09-14 at 09:59.

  12. #12
    Registered User
    Join Date
    Jan 2012
    Posts
    110

    Re: retrieving large amount of data from a XML file

    hi.I have a problem look like you`r problem sunitha.m13 :
    It is fetching the data if XML file contains only one line.

    My data includes almost 100 lines.
    I have tried with 2 lines also...but it is giving error like Error: -991
    can you help me?
    thank a lot...!

  13. #13
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: retrieving large amount of data from a XML file

    Did you already tried suggestion given in #10. Also try pasting some snippet from xml, chances are its format is wrong.

  14. #14
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,673

    Re: retrieving large amount of data from a XML file

    Check XmlParserErrors.h and you will see what -991 means.

  15. #15
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: retrieving large amount of data from a XML file

    Quote Originally Posted by wizard_hu_ View Post
    Check XmlParserErrors.h and you will see what -991 means.
    btw, #9 already says what it is, of course if user has seen

Similar Threads

  1. can we save data in xml file not in DB ?
    By nokia_lin in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-03-09, 11:33
  2. Problem with pyobfuscate
    By JOM in forum Symbian
    Replies: 3
    Last Post: 2008-06-20, 22:47
  3. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  4. Replies: 1
    Last Post: 2005-05-26, 14:22
  5. Replies: 0
    Last Post: 2002-06-10, 12:24

Posting Permissions

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