From 0d4790ae071990d18883c0fb799b938ff53b5c62 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov keep_dom
flag and
terminate it after the object model is destroyed (see
- Section 3.1, "Initializing the Xerces-C++ Runtime").
- The DOM association is also maintained in complete copies of the
- object model (that is, the DOM document is cloned and associations
- are reestablished).
If the keep_dom
flag is passed
+ as the second argument to the copy constructor and the copy
+ being made is of a complete tree, then the DOM association
+ is also maintained in the copy by cloning the underlying
+ DOM document and reestablishing the associations. For example:
+using namespace xercesc; + +XMLPlatformUtils::Initialize (); + +{ + // Parse XML to object model. + // + std::auto_ptr<type> r = root ( + "root.xml", + xml_schema::flags::keep_dom | + xml_schema::flags::dont_initialize); + + // Copy without DOM association. + // + type copy1 (*r); + + // Copy with DOM association. + // + type copy2 (*r, xml_schema::flags::keep_dom); +} + +XMLPlatformUtils::Terminate (); ++
To obtain the corresponding DOM node from an object model node
you will need to call the _node
accessor function
--
cgit v1.1