From f2ec36ab5fa04e11dee655d9c623baac95db1eba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 13 Nov 2013 07:46:45 +0200 Subject: Drop support for Xerces-C++ 2-series --- examples/cxx/tree/performance/parsing.cxx | 54 +------------------------ examples/cxx/tree/performance/serialization.cxx | 22 +--------- 2 files changed, 3 insertions(+), 73 deletions(-) (limited to 'examples/cxx/tree/performance') diff --git a/examples/cxx/tree/performance/parsing.cxx b/examples/cxx/tree/performance/parsing.cxx index 8d662eb..82279a1 100644 --- a/examples/cxx/tree/performance/parsing.cxx +++ b/examples/cxx/tree/performance/parsing.cxx @@ -8,11 +8,7 @@ #include #include -#if _XERCES_VERSION >= 30000 -# include -#else -# include -#endif +#include #include #include @@ -67,8 +63,6 @@ parsing (const char* file, unsigned long iter, bool validate) xsd::cxx::tree::error_handler eh; xsd::cxx::xml::dom::bits::error_handler_proxy ehp (eh); -#if _XERCES_VERSION >= 30000 - xml_schema::dom::auto_ptr parser ( impl->createLSParser (DOMImplementationLS::MODE_SYNCHRONOUS, 0)); @@ -122,48 +116,6 @@ parsing (const char* file, unsigned long iter, bool validate) conf->setParameter (XMLUni::fgXercesUserAdoptsDOMDocument, true); -#else // _XERCES_VERSION >= 30000 - - // Same as above but for Xerces-C++ 2 series. - // - xml_schema::dom::auto_ptr parser ( - impl->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0)); - - parser->setFeature (XMLUni::fgDOMComments, false); - parser->setFeature (XMLUni::fgDOMDatatypeNormalization, true); - parser->setFeature (XMLUni::fgDOMEntities, false); - parser->setFeature (XMLUni::fgDOMNamespaces, true); - parser->setFeature (XMLUni::fgDOMWhitespaceInElementContent, false); - - parser->setErrorHandler (&ehp); - - if (validate) - { - parser->setFeature (XMLUni::fgDOMValidation, true); - parser->setFeature (XMLUni::fgXercesSchema, true); - parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false); - - if (!parser->loadGrammar ("test.xsd", Grammar::SchemaGrammarType, true)) - { - eh.handle ("test.xsd", 0, 0, - xsd::cxx::tree::error_handler::severity::fatal, - "unable to load schema"); - } - - eh.throw_if_failed (); - parser->setFeature (XMLUni::fgXercesUseCachedGrammarInParse, true); - } - else - { - parser->setFeature (XMLUni::fgDOMValidation, false); - parser->setFeature (XMLUni::fgXercesSchema, false); - parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false); - } - - parser->setFeature (XMLUni::fgXercesUserAdoptsDOMDocument, true); - -#endif - // Create memory buffer input source. // MemBufInputSource is ( @@ -179,11 +131,7 @@ parsing (const char* file, unsigned long iter, bool validate) { // First parse XML to DOM reusing the parser we created above. // -#if _XERCES_VERSION >= 30000 xml_schema::dom::auto_ptr doc (parser->parse (&wis)); -#else - xml_schema::dom::auto_ptr doc (parser->parse (wis)); -#endif eh.throw_if_failed (); // Then parse DOM to the object model. diff --git a/examples/cxx/tree/performance/serialization.cxx b/examples/cxx/tree/performance/serialization.cxx index 12c43ae..551d04b 100644 --- a/examples/cxx/tree/performance/serialization.cxx +++ b/examples/cxx/tree/performance/serialization.cxx @@ -8,12 +8,8 @@ #include #include -#if _XERCES_VERSION >= 30000 -# include -# include -#else -# include -#endif +#include +#include #include #include @@ -75,7 +71,6 @@ serialization (const char* file, unsigned long iter) xsd::cxx::tree::error_handler eh; xsd::cxx::xml::dom::bits::error_handler_proxy ehp (eh); -#if _XERCES_VERSION >= 30000 xml_schema::dom::auto_ptr writer ( impl->createLSSerializer ()); @@ -87,14 +82,6 @@ serialization (const char* file, unsigned long iter) xml_schema::dom::auto_ptr out (impl->createLSOutput ()); out->setByteStream (&ft); -#else - // Same as above but for Xerces-C++ 2 series. - // - xml_schema::dom::auto_ptr writer (impl->createDOMWriter ()); - - writer->setErrorHandler (&ehp); - writer->setFeature (XMLUni::fgDOMXMLDeclaration, false); -#endif // Serialization loop. // @@ -110,12 +97,7 @@ serialization (const char* file, unsigned long iter) // Then serialize DOM to XML reusing the serializer we created above. // -#if _XERCES_VERSION >= 30000 writer->write (doc.get (), out.get ()); -#else - writer->writeNode (&ft, *doc); -#endif - eh.throw_if_failed (); } -- cgit v1.1