From a821131cf17a43f55082a660cf323fa72c0aab40 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 Nov 2023 15:35:47 +0200 Subject: Get rid or remaining `using namespace xercesc` in libxsd --- libxsd/xsd/cxx/xml/dom/parsing-source.txx | 36 +++++++++++++++++++------------ 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'libxsd/xsd/cxx/xml/dom/parsing-source.txx') diff --git a/libxsd/xsd/cxx/xml/dom/parsing-source.txx b/libxsd/xsd/cxx/xml/dom/parsing-source.txx index 6543671..2a2d6e2 100644 --- a/libxsd/xsd/cxx/xml/dom/parsing-source.txx +++ b/libxsd/xsd/cxx/xml/dom/parsing-source.txx @@ -105,7 +105,10 @@ namespace xsd const properties& prop, unsigned long flags) { - using namespace xercesc; + // Note: explicitly qualifying everything with xerces:: to avoid + // conflicts with MSXML. + // + using xercesc::XMLUni; // Instantiate the DOM parser. // @@ -115,13 +118,14 @@ namespace xsd // Get an implementation of the Load-Store (LS) interface. // - DOMImplementation* impl ( - DOMImplementationRegistry::getDOMImplementation (ls_id)); + xercesc::DOMImplementation* impl ( + xercesc::DOMImplementationRegistry::getDOMImplementation (ls_id)); - XSD_DOM_AUTO_PTR parser ( - impl->createLSParser (DOMImplementationLS::MODE_SYNCHRONOUS, 0)); + XSD_DOM_AUTO_PTR parser ( + impl->createLSParser ( + xercesc::DOMImplementationLS::MODE_SYNCHRONOUS, 0)); - DOMConfiguration* conf (parser->getDomConfig ()); + xercesc::DOMConfiguration* conf (parser->getDomConfig ()); // Discard comment nodes in the document. // @@ -216,7 +220,7 @@ namespace xsd xercesc::Wrapper4InputSource wrap (&is, false); - XSD_DOM_AUTO_PTR doc; + XSD_DOM_AUTO_PTR doc; try { doc.reset (parser->parse (&wrap)); @@ -249,7 +253,10 @@ namespace xsd const properties& prop, unsigned long flags) { - using namespace xercesc; + // Note: explicitly qualifying everything with xerces:: to avoid + // conflicts with MSXML. + // + using xercesc::XMLUni; // Instantiate the DOM parser. // @@ -259,13 +266,14 @@ namespace xsd // Get an implementation of the Load-Store (LS) interface. // - DOMImplementation* impl ( - DOMImplementationRegistry::getDOMImplementation (ls_id)); + xercesc::DOMImplementation* impl ( + xercesc::DOMImplementationRegistry::getDOMImplementation (ls_id)); - XSD_DOM_AUTO_PTR parser ( - impl->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0)); + XSD_DOM_AUTO_PTR parser ( + impl->createLSParser( + xercesc::DOMImplementationLS::MODE_SYNCHRONOUS, 0)); - DOMConfiguration* conf (parser->getDomConfig ()); + xercesc::DOMConfiguration* conf (parser->getDomConfig ()); // Discard comment nodes in the document. // @@ -359,7 +367,7 @@ namespace xsd bits::error_handler_proxy ehp (eh); conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp); - XSD_DOM_AUTO_PTR doc; + XSD_DOM_AUTO_PTR doc; try { doc.reset (parser->parseURI (string (uri).c_str ())); -- cgit v1.1