Results 1 to 3 of 3

Thread: QDomDocument or QXmlStreamReader

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2014
    Posts
    14
    Thanks
    3
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default QDomDocument or QXmlStreamReader

    I've got an XML response, and I'm wondering which method is best to use to obtain the required information I need. I want to run through the XML, looking for specific elements and checking the text within.
    Current code:

    Qt Code:
    1. QXmlStreamReader sr(response);
    2.  
    3. while (!sr.atEnd())
    4. {
    5. sr.readNext();
    6.  
    7. if(sr.name() == "FeedSubmissionId")
    8. {
    9. QByteArray FeedSubmissionID = sr.readElementText().toUtf8();
    10. GetFeedSubmissionList(FeedSubmissionID);
    11. }
    12. }
    13. if (sr.hasError())
    14. {
    15. QString err = sr.errorString();
    16. qDebug() << err;
    17. }
    To copy to clipboard, switch view to plain text mode 


    Any advice would be much appreciated.

    Regards,

    Richard
    Last edited by Poonarge; 14th July 2014 at 10:05.

Similar Threads

  1. QXmlStreamReader help?
    By nthung in forum Newbie
    Replies: 2
    Last Post: 4th October 2011, 09:03
  2. QDomDocument or QXmlStreamWriter, QXmlStreamReader
    By calmspeaker in forum Qt Programming
    Replies: 6
    Last Post: 15th December 2010, 09:57
  3. Need help with QXmlStreamReader
    By jknotzke in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2009, 09:26
  4. Split QDomDocument to new QDomDocument
    By estanisgeyer in forum Qt Programming
    Replies: 4
    Last Post: 28th January 2009, 09:59
  5. QDomDocument inside other QDomDocument
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2008, 15:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.