, _doc (xmlCopyDoc (from->_doc, 1))
, _compression(from->compression())
{
-
+
}
XMLTree::~XMLTree()
} else {
_doc = xmlParseFile(_filename.c_str());
}
-
+
/* check if parsing suceeded */
if (_doc == NULL) {
if (validate) {
if (validate) {
xmlFreeParserCtxt(ctxt);
}
-
+
return true;
}
XMLPropertyIterator curprop;
XMLNodeList nodes;
XMLNodeIterator curnode;
-
+
clear_lists ();
_name = from.name();
set_content(from.content());
-
+
props = from.properties();
for (curprop = props.begin(); curprop != props.end(); ++curprop) {
add_property((*curprop)->name().c_str(), (*curprop)->value());
}
-
+
nodes = from.children();
for (curnode = nodes.begin(); curnode != nodes.end(); ++curnode) {
add_child_copy(**curnode);
} else {
ctxt = xmlXPathNewContext(_doc);
}
-
+
boost::shared_ptr<XMLSharedNodeList> result =
boost::shared_ptr<XMLSharedNodeList>(find_impl(ctxt, xpath));
-
+
xmlXPathFreeContext(ctxt);
if (doc) {
xmlFreeDoc (doc);
{
string ns(n);
map<string,XMLProperty*>::iterator iter;
-
+
if ((iter = _propmap.find(ns)) != _propmap.end()) {
iter->second->set_value (v);
return iter->second;
s << " " << (*i)->name() << "=\"" << (*i)->value() << "\"";
}
s << ">\n";
-
+
for (XMLNodeList::const_iterator i = _children.begin(); i != _children.end(); ++i) {
(*i)->dump (s, p + " ");
}
-
+
s << p << "</" << _name << ">\n";
}
}