diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:46 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:46 +0100 |
commit | 372a0e99c2f61543d9e14d9933b59d9d1f4cb26e (patch) | |
tree | bbadf39aed0610c8f8f7b41fefff47773b8ac205 /xsd/examples/cxx/tree/custom/mixed/people-custom.cxx | |
parent | 23d41842168ac1a1580111b9c5c73500ceee3d57 (diff) | |
parent | 4538829ab86b5a1cd4e845e7eab165029c9d6d46 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'xsd/examples/cxx/tree/custom/mixed/people-custom.cxx')
-rw-r--r-- | xsd/examples/cxx/tree/custom/mixed/people-custom.cxx | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/xsd/examples/cxx/tree/custom/mixed/people-custom.cxx b/xsd/examples/cxx/tree/custom/mixed/people-custom.cxx deleted file mode 100644 index 7cd1947..0000000 --- a/xsd/examples/cxx/tree/custom/mixed/people-custom.cxx +++ /dev/null @@ -1,89 +0,0 @@ -// file : examples/cxx/tree/custom/mixed/people-custom.cxx -// copyright : not copyrighted - public domain - -#include <ostream> - -// Include people.hxx instead of people-custom.hxx here. -// -#include "people.hxx" - -namespace people -{ - using namespace xercesc; - - const XMLCh ls[] = {chLatin_L, chLatin_S, chNull}; - - bio:: - bio () - : xhtml_ (0) - { - DOMImplementation* impl ( - DOMImplementationRegistry::getDOMImplementation (ls)); - - doc_.reset (impl->createDocument ()); - } - - bio:: - bio (const DOMElement& e, - xml_schema::flags f, - xml_schema::container* c) - : bio_base (e, f, c), xhtml_ (0) - { - DOMImplementation* impl ( - DOMImplementationRegistry::getDOMImplementation (ls)); - - doc_.reset (impl->createDocument ()); - - // Copy the xhtml element. Assume the first child element in - // e is always xhtml. - // - for (DOMNode* n (e.getFirstChild ()); n != 0; n = n->getNextSibling ()) - { - if (n->getNodeType () == DOMNode::ELEMENT_NODE) - { - xhtml_ = static_cast<DOMElement*> (doc_->importNode (n, true)); - break; - } - } - } - - bio:: - bio (const bio& d, - xml_schema::flags f, - xml_schema::container* c) - : bio_base (d, f, c), xhtml_ (0) - { - DOMImplementation* impl ( - DOMImplementationRegistry::getDOMImplementation (ls)); - - doc_.reset (impl->createDocument ()); - - xhtml_ = static_cast<DOMElement*> ( - doc_->importNode (const_cast<DOMElement*> (d.xhtml_), true)); - } - - bio* bio:: - _clone (xml_schema::flags f, xml_schema::container* c) const - { - return new bio (*this, f, c); - } - - void - operator<< (DOMElement& e, const bio& x) - { - // Allow our base to serialize first. - // - const bio_base& b (x); - e << b; - - // Copy the XHTML fragment if we have one. - // - const DOMElement* xhtml (x.xhtml ()); - - if (xhtml != 0) - { - DOMDocument* doc (e.getOwnerDocument ()); - e.appendChild (doc->importNode (const_cast<DOMElement*> (xhtml), true)); - } - } -} |