summaryrefslogtreecommitdiff
path: root/src/xmlpatterns
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlpatterns')
-rw-r--r--src/xmlpatterns/api/qxmlschema_p.cpp6
-rw-r--r--src/xmlpatterns/api/qxmlschemavalidator.cpp13
2 files changed, 11 insertions, 8 deletions
diff --git a/src/xmlpatterns/api/qxmlschema_p.cpp b/src/xmlpatterns/api/qxmlschema_p.cpp
index d87b465..30cadd7 100644
--- a/src/xmlpatterns/api/qxmlschema_p.cpp
+++ b/src/xmlpatterns/api/qxmlschema_p.cpp
@@ -97,8 +97,10 @@ void QXmlSchemaPrivate::load(const QUrl &source, const QString &targetNamespace)
m_schemaContext->setUriResolver(uriResolver());
m_schemaContext->setNetworkAccessManager(networkAccessManager());
- const QPatternist::AutoPtr<QNetworkReply> reply(QPatternist::AccelTreeResourceLoader::load(source, m_schemaContext->networkAccessManager(),
- m_schemaContext, QPatternist::AccelTreeResourceLoader::ContinueOnError));
+ const QPatternist::AutoPtr<QNetworkReply> reply(
+ QPatternist::AccelTreeResourceLoader::load(
+ m_documentUri, m_schemaContext->networkAccessManager(),
+ m_schemaContext, QPatternist::AccelTreeResourceLoader::ContinueOnError));
if (reply)
load(reply.data(), source, targetNamespace);
}
diff --git a/src/xmlpatterns/api/qxmlschemavalidator.cpp b/src/xmlpatterns/api/qxmlschemavalidator.cpp
index f4a25df..112d780 100644
--- a/src/xmlpatterns/api/qxmlschemavalidator.cpp
+++ b/src/xmlpatterns/api/qxmlschemavalidator.cpp
@@ -154,13 +154,14 @@ bool QXmlSchemaValidator::validate(const QUrl &source) const
d->m_context->setMessageHandler(messageHandler());
d->m_context->setUriResolver(uriResolver());
d->m_context->setNetworkAccessManager(networkAccessManager());
+ const QUrl resolved = QPatternist::XPathHelper::normalizeQueryURI(source);
- const QPatternist::AutoPtr<QNetworkReply> reply(QPatternist::AccelTreeResourceLoader::load(source, d->m_context->networkAccessManager(),
- d->m_context, QPatternist::AccelTreeResourceLoader::ContinueOnError));
- if (reply)
- return validate(reply.data(), source);
- else
- return false;
+ const QPatternist::AutoPtr<QNetworkReply> reply(
+ QPatternist::AccelTreeResourceLoader::load(
+ resolved, d->m_context->networkAccessManager(),
+ d->m_context, QPatternist::AccelTreeResourceLoader::ContinueOnError));
+
+ return reply && validate(reply.data(), source);
}
/*!