Results 1 to 3 of 3

Thread: Verifying XML loaded/saved

  1. #1
    Join Date
    Aug 2010
    Posts
    99
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question Verifying XML loaded/saved

    Hi all.

    I have an application and i want to save and load some data in it using xml (as you do). I could do that quite easily but i want to make sure the data is valid according to a DTD or something. That is, i want the xml document structure to be the same when writing the data from my application and when reading it in. Also, it will mean i don't have to do as much checking to make sure the structure is correct.

    So my question is how to do this in Qt. I already know how to read an xml file into a QDomDocument, i just want to know about DTD or schema validation or whatever it is.

    thanks
    [Window Detective] - Windows UI spy utility
    [War Thunder]

  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: Verifying XML loaded/saved

    Have you seen this example ? It shows how to use QXmlSchema to validate xml document based on predefined schema.

  3. #3
    Join Date
    Aug 2010
    Posts
    99
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Verifying XML loaded/saved

    Yes, actually i have. But i am not sure what the difference is between xml schema and DTD. Also, i was wondering if i need to set/validate against a schema when creating and writing the xml. Or is that only necessary when reading it and i should just make sure my code writes the xml correctly?
    [Window Detective] - Windows UI spy utility
    [War Thunder]

Similar Threads

  1. Replies: 1
    Last Post: 24th April 2010, 03:43
  2. Automatic file extension is not added to saved file on mac os x
    By sanjayshelke in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2009, 06:56
  3. Replies: 2
    Last Post: 15th February 2008, 18:54
  4. Qtopia-4.2 Restoring the Saved Values for QComboBoxes
    By arunvv in forum Qt Programming
    Replies: 10
    Last Post: 7th May 2007, 19:56

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.