Results 1 to 10 of 10

Thread: Problems reading XML with QDomDocument

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Join Date
    Feb 2008
    Posts
    98
    Thanks
    2
    Thanked 24 Times in 24 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems reading XML with QDomDocument

    You get the first child, which would be "phones". Then you try to get its siblings but it doesn't have any. You need to get the children of phones. So you can do:

    Qt Code:
    1. d.setContent(&file);
    2.  
    3. QDomNode n = d.firstChild();
    4. if(!n.isNull() || !n.hasChildNodes())
    5. return;
    6.  
    7. n = n.firstChild();
    8.  
    9. ClearPhoneNumbers(); // Clear phone table.
    10.  
    11. while(!n.isNull()) {
    12. ...
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to victor.fernandez for this useful post:

    grantbj74 (27th August 2009)

Similar Threads

  1. Mac OSX OpenGL problems
    By tksharpless in forum Qt Programming
    Replies: 0
    Last Post: 23rd March 2009, 17:27
  2. QDomDocument inside other QDomDocument
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2008, 15:27
  3. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  4. QWT 5, QT3, SuSE 10.2. Crash and burn
    By DrMcCleod in forum Qwt
    Replies: 8
    Last Post: 7th September 2007, 20:53
  5. Adding whitespace in QDomDocument
    By jakamph in forum Newbie
    Replies: 4
    Last Post: 6th February 2006, 22:06

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.