From 74c5b68583f0dc3a860c068aa1aa56d1948bb17e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Feb 2010 12:23:16 +0200 Subject: Disable loading schemas from document if external location is provided --- libxsd/xsd/cxx/xml/dom/parsing-source.txx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 (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 ehp (eh); @@ -405,6 +415,16 @@ namespace xsd const_cast (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 ehp (eh); -- cgit v1.1