ofXml::ofXml( const ofXml& rhs ) { document = new Poco::XML::Document(); Poco::XML::Node *n = document->importNode(rhs.getPocoDocument()->documentElement(), true); document->appendChild(n); element = document->documentElement(); }
void ofXml::addXml( ofXml& xml, bool copyAll ) { Poco::XML::Node *n = 0; if(copyAll) { n = document->importNode(xml.getPocoDocument()->documentElement(), true); } else { if(xml.getPocoElement() == 0 || xml.getPocoElement() == xml.getPocoDocument()->documentElement()) { n = document->importNode(xml.getPocoDocument()->documentElement(), true); } else { n = document->importNode( xml.getPocoElement(), true); } } // we have an element, i.e. the document has child nodes // or we don't, so append it directly to the document if( element ) { element->appendChild(n); } else { document->appendChild(n); } }