Results 1 to 2 of 2

Thread: Accessing DTD in an XML file via QtXml module?

  1. #1
    Join Date
    May 2006
    Location
    Finland
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Accessing DTD in an XML file via QtXml module?

    QT's XML parsers (DOM and SAX) can not validate that the XML file conforms to the possible DTD given in the file. I can live with that.

    However, I would like to use the DTD information myself, and I have not found a way to do it with QT. I have used DOM parsing, and QDomImplementation has a function "createDocumentType" but no examples are given, and I have not been able to find the right way to use it myself.

    It breaks my heart to hard-code the DTD into my program (to assume while writing the code that for example element "paragraph" is always a child of element "myDocument" etc.). I would like to do this in a generic way -

    - read in the XML file including the DTD, no need to validate the XML file
    - display the XML file elements as a tree (not the DTD info)
    - edit the tree and verify at least some of the edit actions by using the DTD information (like copy-paste of the subtrees etc)
    - save the tree

    surely this cannot require a full-validating XML parser if I make my possible trees simple enough? But how should it be done? Has anyone got an example?

    - Jorma

  2. #2
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Post Re: Accessing DTD in an XML file via QtXml module?

    There is an example in the Qt package "Simple DOM model"

    $QTDIR/itemviews/simpledommodel/

    also a part of Qtdemo (ofcourse!) under the same hierarchy...try it, it may be of some help!

Similar Threads

  1. QtHelp Module - registering compressed help file gives error
    By Ankitha Varsha in forum Qt Programming
    Replies: 1
    Last Post: 16th May 2008, 14:14
  2. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. Can I use the Sql Module without chanage .pro file?
    By fengtian.we in forum Qt Programming
    Replies: 9
    Last Post: 21st May 2007, 10:59
  5. Accessing the entire file..
    By Kapil in forum Newbie
    Replies: 1
    Last Post: 28th April 2006, 07:41

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.