summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/messaging
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-11-13 07:46:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-11-13 07:46:45 +0200
commitf2ec36ab5fa04e11dee655d9c623baac95db1eba (patch)
treef1f51bc34e749ca1f97e2e722a334fc599c8a124 /examples/cxx/tree/messaging
parent6e9a647a859d9a95c96e75c77beaf41b166cc4e4 (diff)
Drop support for Xerces-C++ 2-series
Diffstat (limited to 'examples/cxx/tree/messaging')
-rw-r--r--examples/cxx/tree/messaging/dom-parse.cxx31
-rw-r--r--examples/cxx/tree/messaging/dom-serialize.cxx25
2 files changed, 0 insertions, 56 deletions
diff --git a/examples/cxx/tree/messaging/dom-parse.cxx b/examples/cxx/tree/messaging/dom-parse.cxx
index e4bc6cc..1596f4e 100644
--- a/examples/cxx/tree/messaging/dom-parse.cxx
+++ b/examples/cxx/tree/messaging/dom-parse.cxx
@@ -30,10 +30,6 @@ parse (std::istream& is, const std::string& id, bool validate)
DOMImplementation* impl (
DOMImplementationRegistry::getDOMImplementation (ls_id));
-#if _XERCES_VERSION >= 30000
-
- // Xerces-C++ 3.0.0 and later.
- //
xml::dom::auto_ptr<DOMLSParser> parser (
impl->createLSParser (DOMImplementationLS::MODE_SYNCHRONOUS, 0));
@@ -85,39 +81,12 @@ parse (std::istream& is, const std::string& id, bool validate)
xml::dom::bits::error_handler_proxy<char> ehp (eh);
conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp);
-#else // _XERCES_VERSION >= 30000
-
- // Same as above but for Xerces-C++ 2 series.
- //
- xml::dom::auto_ptr<DOMBuilder> 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->setFeature (XMLUni::fgDOMValidation, validate);
- parser->setFeature (XMLUni::fgXercesSchema, validate);
- parser->setFeature (XMLUni::fgXercesSchemaFullChecking, false);
- parser->setFeature (XMLUni::fgXercesUserAdoptsDOMDocument, true);
-
- tree::error_handler<char> eh;
- xml::dom::bits::error_handler_proxy<char> ehp (eh);
- parser->setErrorHandler (&ehp);
-
-#endif // _XERCES_VERSION >= 30000
-
// Prepare input stream.
//
xml::sax::std_input_source isrc (is, id);
Wrapper4InputSource wrap (&isrc, false);
-#if _XERCES_VERSION >= 30000
xml::dom::auto_ptr<DOMDocument> doc (parser->parse (&wrap));
-#else
- xml::dom::auto_ptr<DOMDocument> doc (parser->parse (wrap));
-#endif
eh.throw_if_failed<tree::parsing<char> > ();
diff --git a/examples/cxx/tree/messaging/dom-serialize.cxx b/examples/cxx/tree/messaging/dom-serialize.cxx
index c0f4311..e303e9c 100644
--- a/examples/cxx/tree/messaging/dom-serialize.cxx
+++ b/examples/cxx/tree/messaging/dom-serialize.cxx
@@ -38,8 +38,6 @@ serialize (std::ostream& os,
xml::dom::ostream_format_target oft (os);
-#if _XERCES_VERSION >= 30000
-
// Create a DOMSerializer.
//
xml::dom::auto_ptr<DOMLSSerializer> writer (
@@ -62,28 +60,5 @@ serialize (std::ostream& os,
writer->write (&doc, out.get ());
-#else
-
- // Create a DOMWriter.
- //
- xml::dom::auto_ptr<DOMWriter> writer (impl->createDOMWriter ());
-
- // Set error handler.
- //
- writer->setErrorHandler (&ehp);
-
- // Set encoding.
- //
- writer->setEncoding(xml::string (encoding).c_str ());
-
- // Set some generally nice features.
- //
- writer->setFeature (XMLUni::fgDOMWRTDiscardDefaultContent, true);
- writer->setFeature (XMLUni::fgDOMWRTFormatPrettyPrint, true);
-
- writer->writeNode (&oft, doc);
-
-#endif
-
eh.throw_if_failed<tree::serialization<char> > ();
}