Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.7.0, 4.8.4
-
All
Description
The documentation states that it should be possible to set a subclass of QAbstractUrlResolver on an instance of QXmlSchemaValidator in order to circumvent network access for schema (.xsd) resources. When this is tried in practice, the resolve() method of the subclass is never called.
To work around this problem (so that a network connection is not required to use XML schema and instances together, it is necessary to create a subclass of QNetworkAccessManager and to re-implement createRequest so that it creates a network request that refers to local resources and not network resources. Network resources are embedded inside schema files but are also available to download and copy into the application run directory for local reference.
The attached example demonstrates the work-around. However, if you uncomment the line which sets the network access manager on the validator, the code will not be able to validate the xml without a network connection.