Results 1 to 2 of 2

Thread: XMLDomElement text gives text of all child nodes

  1. #1
    Join Date
    Feb 2011
    Posts
    1
    Platforms
    MacOS X Unix/X11

    Default XMLDomElement text gives text of all child nodes

    So i have some variables:
    QString result;
    QDomElement element;

    Element is parsed from an xml file and childnodes with attributes, some of them contain text.

    So i know how to walk through the DOM tree and i want text from specific childnodes, but

    result += element.text();

    returns me the text ALL childnodes.. but i only want the text from the one element and not its childs...

    How do i do that?

    Thx in advance

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: XMLDomElement text gives text of all child nodes

    Maybe post example xml and the output you expect to get.

Similar Threads

  1. Replies: 2
    Last Post: 4th December 2010, 08:09
  2. Replies: 0
    Last Post: 2nd August 2010, 09:37
  3. QTreeWidget get a text from child item
    By vcp in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 17:36
  4. Replies: 1
    Last Post: 3rd September 2008, 14:16
  5. Having trouble with direct child nodes using QtXml
    By thelackey3326 in forum Qt Programming
    Replies: 2
    Last Post: 16th July 2008, 21:12

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.