summaryrefslogtreecommitdiff
path: root/xsd/tests/cxx/tree/dom-association/dom-parse.cxx
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
commit4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch)
treebbadf39aed0610c8f8f7b41fefff47773b8ac205 /xsd/tests/cxx/tree/dom-association/dom-parse.cxx
parent23d41842168ac1a1580111b9c5c73500ceee3d57 (diff)
parentaad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (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/tests/cxx/tree/dom-association/dom-parse.cxx')
-rw-r--r--xsd/tests/cxx/tree/dom-association/dom-parse.cxx96
1 files changed, 0 insertions, 96 deletions
diff --git a/xsd/tests/cxx/tree/dom-association/dom-parse.cxx b/xsd/tests/cxx/tree/dom-association/dom-parse.cxx
deleted file mode 100644
index c065d19..0000000
--- a/xsd/tests/cxx/tree/dom-association/dom-parse.cxx
+++ /dev/null
@@ -1,96 +0,0 @@
-// file : tests/cxx/tree/dom-association/dom-parse.cxx
-// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-#include "dom-parse.hxx"
-
-#include <istream>
-
-#include <xercesc/dom/DOM.hpp>
-#include <xercesc/util/XMLUniDefs.hpp> // chLatin_*
-#include <xercesc/framework/Wrapper4InputSource.hpp>
-
-#include <xsd/cxx/xml/sax/std-input-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;
-
-XSD_DOM_AUTO_PTR<DOMDocument>
-parse (std::istream& is,
- const std::string& id,
- bool validate)
-{
- const XMLCh ls_id [] = {chLatin_L, chLatin_S, chNull};
-
- // Get an implementation of the Load-Store (LS) interface.
- //
- DOMImplementation* impl (
- DOMImplementationRegistry::getDOMImplementation (ls_id));
-
- XSD_DOM_AUTO_PTR<DOMLSParser> parser (
- impl->createLSParser (DOMImplementationLS::MODE_SYNCHRONOUS, 0));
-
- DOMConfiguration* conf (parser->getDomConfig ());
-
- // Discard comment nodes in the document.
- //
- conf->setParameter (XMLUni::fgDOMComments, false);
-
- // Enable datatype normalization.
- //
- conf->setParameter (XMLUni::fgDOMDatatypeNormalization, true);
-
- // Do not create EntityReference nodes in the DOM tree. No
- // EntityReference nodes will be created, only the nodes
- // corresponding to their fully expanded substitution text
- // will be created.
- //
- conf->setParameter (XMLUni::fgDOMEntities, false);
-
- // Perform namespace processing.
- //
- conf->setParameter (XMLUni::fgDOMNamespaces, true);
-
- // Do not include ignorable whitespace in the DOM tree.
- //
- conf->setParameter (XMLUni::fgDOMElementContentWhitespace, false);
-
- // Enable/Disable validation.
- //
- conf->setParameter (XMLUni::fgDOMValidate, validate);
- conf->setParameter (XMLUni::fgXercesSchema, validate);
- conf->setParameter (XMLUni::fgXercesSchemaFullChecking, false);
-
- // Xerces-C++ 3.1.0 is the first version with working multi import
- // support.
- //
-#if _XERCES_VERSION >= 30100
- conf->setParameter (XMLUni::fgXercesHandleMultipleImports, true);
-#endif
-
- // We will release the DOM document ourselves.
- //
- conf->setParameter (XMLUni::fgXercesUserAdoptsDOMDocument, true);
-
- // Set error handler.
- //
- tree::error_handler<char> eh;
- xml::dom::bits::error_handler_proxy<char> ehp (eh);
- conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp);
-
- // Prepare input stream.
- //
- xml::sax::std_input_source isrc (is, id);
- Wrapper4InputSource wrap (&isrc, false);
-
- XSD_DOM_AUTO_PTR<DOMDocument> doc (parser->parse (&wrap));
-
- eh.throw_if_failed<tree::parsing<char> > ();
-
- return doc;
-}