2 Attachment(s)
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 :mad:.
Is this an issue with Qt's validation, or am I doing something obviously stupid in my schema that I have missed.
Code:
QFile schemaFile
("schema.xsd");
QXmlSchema schema;
schema.
load(&file,
QUrl::fromLocalFile(schemaFile.
fileName()));
if (schema.isValid()) {
QFile file("document.xml");
QXmlSchemaValidator validator(schema);
if (validator.
validate(&file,
QUrl::fromLocalFile(file.
fileName()))) qDebug() << "instance document is valid";
else
qDebug() << "instance document is invalid";
}