Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.3
-
None
-
Windows 7 64 bit Microsoft Visual Studio 2015
Description
I try to use QXmlSchemaValidator::validate method without QUrl and my test fails because of a QASSERT on the QUrl validity.
The problem seems to come because QXmlSchemaValidator::validate has a default QUrl parameter and this parameter is an empty Url (not a valid one). If we must have a valid Url, it can't be a (invalid) default one.
My test :
QXmlSchema schema; schema.load(schemaData); QXmlSchema Validator validator(schema); if (!validator.validate(instanceData))) { std::cout << "Invalid xml file" << std::endl; }
QXmlSchemaValidator.h :
bool validate(const QByteArray &data, const QUrl &documentUri = QUrl()) const;
QAccelTreeResourceLoader.cpp :
bool AccelTreeResourceLoader::retrieveDocument(QIODevice *source, const QUrl &documentUri, const ReportContext::Ptr &context) { Q_ASSERT(source); Q_ASSERT(source->isReadable()); Q_ASSERT(documentUri.isValid()); ... }