Results 1 to 1 of 1

Thread: QXmlSchemaValidator validate hanging

  1. #1
    Join Date
    Aug 2015
    Qt products
    Qt4 Qt5
    MacOS X Unix/X11 Windows

    Default QXmlSchemaValidator validate hanging

    Using the example in the documentation of the QXmlSchemaValidator Class, I am attempting to validate a simple xml document against a very simple schema (See attached files).
    Once calling the validate() method on the validator, my application hangs for a while before exiting out .

    Is this an issue with Qt's validation, or am I doing something obviously stupid in my schema that I have missed.

    Qt Code:
    1. QFile schemaFile("schema.xsd");
    4. QXmlSchema schema;
    5. schema.load(&file, QUrl::fromLocalFile(schemaFile.fileName()));
    7. if (schema.isValid()) {
    8. QFile file("document.xml");
    11. QXmlSchemaValidator validator(schema);
    12. if (validator.validate(&file, QUrl::fromLocalFile(file.fileName())))
    13. qDebug() << "instance document is valid";
    14. else
    15. qDebug() << "instance document is invalid";
    16. }
    To copy to clipboard, switch view to plain text mode 
    Attached Files Attached Files

Similar Threads

  1. QPlainTextEdit - hanging indents
    By Acamapichtli in forum Qt Programming
    Replies: 0
    Last Post: 15th May 2014, 19:28
  2. QFileSystemWatcher hanging in slot
    By jf00071 in forum Qt Programming
    Replies: 6
    Last Post: 9th March 2012, 12:40
  3. Infinite loop in QXmlSchemaValidator::validate()?
    By TropicalPenguin in forum Qt Programming
    Replies: 0
    Last Post: 9th November 2010, 16:09
  4. Default values in QXmlSchemaValidator
    By mortalisk in forum Qt Programming
    Replies: 0
    Last Post: 3rd September 2010, 17:11
  5. Qprocess...hanging entire application!!!!
    By nupul in forum Qt Programming
    Replies: 5
    Last Post: 10th May 2006, 15:24

Tags for this Thread


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.