#include #include #include #include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); const std::vector schemaNames { ":/schema-def.xsd", ":/schema-def-slower.xsd", ":/schema-def-slow.xsd" }; for (const auto& schemaName : schemaNames) { QXmlSchema schema; schema.load(QUrl::fromLocalFile(schemaName)); qDebug() << "======================================"; qDebug() << "Schema" << schemaName << " valid:" << schema.isValid(); const auto start = QDateTime::currentDateTime(); QXmlSchemaValidator validator(schema); qDebug() << "XML valid:" << validator.validate(QUrl::fromLocalFile(":/schema.xml")); qDebug() << "Validation took:" << start.msecsTo(QDateTime::currentDateTime()) << "ms"; } return 0; }