Results 1 to 2 of 2

Thread: an XML object

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Question an XML object

    Hello,
    while I'm parsing a XML file (xmlreader) I must create an object (MYXML) that represent it; I was thinking something about this:
    Qt Code:
    1. <xml>
    2. <body>
    3. <book>
    4. <title> Hello </title>
    5. </book>
    6. </body>
    7. <xml>
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. class MYXML {
    2. private Elementroot = new Element();
    3. public MYXML() { }
    4.  
    5. public class Element {
    6. String text;
    7. List<Attribute> att = new List<Attribute>(); //can be empty
    8. List<Element> childs = List<Element> (); //can be empty
    9. }
    10.  
    11. public class Attribute {
    12. String name = null;
    13. String value = null;
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    Can be fine? Do you know where can I find an example of this thing? I saw a QT class that implements exactly what I want to do but I can't find it.
    thanks
    Regards

  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: an XML object

    How are the two code snippets related to each other?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Getting std::string object from QString object ( qt3)
    By joseph in forum Qt Programming
    Replies: 11
    Last Post: 28th March 2013, 20:09
  2. writing object to the file(Object Persistance)
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 14:28
  3. qt and swf object
    By nimes in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2009, 03:21
  4. Open a QMainWindow Object in QDialog Object
    By chuengchuenghq in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2008, 06:33
  5. Getting type of object
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 29th November 2007, 14:38

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.