diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 |
commit | 4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch) | |
tree | bbadf39aed0610c8f8f7b41fefff47773b8ac205 /xsd/examples/cxx/tree/messaging/dom-serialize.cxx | |
parent | 23d41842168ac1a1580111b9c5c73500ceee3d57 (diff) | |
parent | aad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (diff) |
Update upstream source from tag 'upstream/4.2.0'
Update to upstream version '4.2.0'
with Debian dir 1b38df7bbcf313223de3c50107ac0255090fe647
Diffstat (limited to 'xsd/examples/cxx/tree/messaging/dom-serialize.cxx')
-rw-r--r-- | xsd/examples/cxx/tree/messaging/dom-serialize.cxx | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/xsd/examples/cxx/tree/messaging/dom-serialize.cxx b/xsd/examples/cxx/tree/messaging/dom-serialize.cxx deleted file mode 100644 index dbf3370..0000000 --- a/xsd/examples/cxx/tree/messaging/dom-serialize.cxx +++ /dev/null @@ -1,64 +0,0 @@ -// file : examples/cxx/tree/messaging/dom-serialize.cxx -// copyright : not copyrighted - public domain - -#include "dom-serialize.hxx" - -#include <ostream> - -#include <xercesc/dom/DOM.hpp> -#include <xercesc/util/XMLUniDefs.hpp> - -#include <xsd/cxx/xml/string.hxx> -#include <xsd/cxx/xml/dom/auto-ptr.hxx> -#include <xsd/cxx/xml/dom/serialization-source.hxx> -#include <xsd/cxx/xml/dom/bits/error-handler-proxy.hxx> - -#include <xsd/cxx/tree/exceptions.hxx> -#include <xsd/cxx/tree/error-handler.hxx> - -using namespace xercesc; -namespace xml = xsd::cxx::xml; -namespace tree = xsd::cxx::tree; - -void -serialize (std::ostream& os, - const xercesc::DOMDocument& doc, - const std::string& encoding) -{ - const XMLCh ls_id [] = {chLatin_L, chLatin_S, chNull}; - - // Get an implementation of the Load-Store (LS) interface. - // - DOMImplementation* impl ( - DOMImplementationRegistry::getDOMImplementation (ls_id)); - - tree::error_handler<char> eh; - xml::dom::bits::error_handler_proxy<char> ehp (eh); - - xml::dom::ostream_format_target oft (os); - - // Create a DOMSerializer. - // - xml::dom::auto_ptr<DOMLSSerializer> writer ( - impl->createLSSerializer ()); - - DOMConfiguration* conf (writer->getDomConfig ()); - - // Set error handler. - // - conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp); - - // Set some generally nice features. - // - conf->setParameter (XMLUni::fgDOMWRTDiscardDefaultContent, true); - conf->setParameter (XMLUni::fgDOMWRTFormatPrettyPrint, true); - conf->setParameter (XMLUni::fgDOMWRTXercesPrettyPrint, false); - - xml::dom::auto_ptr<DOMLSOutput> out (impl->createLSOutput ()); - out->setEncoding (xml::string (encoding).c_str ()); - out->setByteStream (&oft); - - writer->write (&doc, out.get ()); - - eh.throw_if_failed<tree::serialization<char> > (); -} |