summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-02-03 12:23:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-02-03 12:23:16 +0200
commit74c5b68583f0dc3a860c068aa1aa56d1948bb17e (patch)
treeae62624bfdb8557748b9a8387b86444d9dc67058
parentf2b9bf3f35526ed4a5d6c359be1cb1293cacafdf (diff)
Disable loading schemas from document if external location is provided
-rw-r--r--libxsd/xsd/cxx/xml/dom/parsing-source.txx20
1 files changed, 20 insertions, 0 deletions
diff --git a/libxsd/xsd/cxx/xml/dom/parsing-source.txx b/libxsd/xsd/cxx/xml/dom/parsing-source.txx
index 59cb153..50fa285 100644
--- a/libxsd/xsd/cxx/xml/dom/parsing-source.txx
+++ b/libxsd/xsd/cxx/xml/dom/parsing-source.txx
@@ -199,6 +199,16 @@ namespace xsd
const_cast<void*> (v));
}
+ // If external schema location was specified, disable loading
+ // schemas via the schema location attributes in the document.
+ //
+#if _XERCES_VERSION >= 30100
+ if (!prop.schema_location ().empty () ||
+ !prop.no_namespace_schema_location ().empty ())
+ {
+ conf->setParameter (XMLUni::fgXercesLoadSchema, false);
+ }
+#endif
// Set error handler.
//
bits::error_handler_proxy<C> ehp (eh);
@@ -405,6 +415,16 @@ namespace xsd
const_cast<void*> (v));
}
+ // If external schema location was specified, disable loading
+ // schemas via the schema location attributes in the document.
+ //
+#if _XERCES_VERSION >= 30100
+ if (!prop.schema_location ().empty () ||
+ !prop.no_namespace_schema_location ().empty ())
+ {
+ conf->setParameter (XMLUni::fgXercesLoadSchema, false);
+ }
+#endif
// Set error handler.
//
bits::error_handler_proxy<C> ehp (eh);