Results 1 to 2 of 2

Thread: reading XML

  1. #1
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Unhappy reading XML

    hai all,

    I need to read( as string ) the xml as follows

    [HTML]

    <parent>
    <child attr1="00001 " attr2="PPPP" /> // only this row i need to pass to function
    <child attr1="00002" attr2="qqqqq" />

    </parent>

    [/HTML]

    i need to pass this <child attr1="00001 " attr2="PPPP" /> as QString to a function , say
    void foo( cosnt QString & xml );
    please help me.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: reading XML

    Use QDomDocument and QDomElement. The attribute() method will help you get a grip on the value of each attribute.

Similar Threads

  1. Replies: 6
    Last Post: 8th January 2007, 10:24
  2. Server not reading
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 7th December 2006, 14:45
  3. QDataStream reading into QString
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 15th October 2006, 09:22
  4. Replies: 2
    Last Post: 4th May 2006, 19:17
  5. Reading QByteArray from QDataStream Qt3.3
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 20:23

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.