X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fxml%2B%2B.cc;h=d691b0bd8224687eb1d62bf30ae52490aaf6d8cd;hb=69b7b53aec2c2857dd02ed6c03fc54db2e044cd0;hp=90d7c3cf4879720fd523fcdea47e3037b3162af1;hpb=271f298635567b7aef922316e14b910fda0c508e;p=ardour.git diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index 90d7c3cf48..d691b0bd82 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -5,6 +5,7 @@ * Modified for Ardour and released under the same terms. */ +#include #include "pbd/xml++.h" #include #include @@ -95,7 +96,6 @@ XMLTree::read_internal(bool validate) if (validate && ctxt->valid == 0) { xmlFreeParserCtxt(ctxt); xmlFreeDoc(doc); - xmlCleanupParser(); throw XMLException("Failed to validate document " + _filename); } } @@ -107,7 +107,6 @@ XMLTree::read_internal(bool validate) xmlFreeParserCtxt(ctxt); } xmlFreeDoc(doc); - xmlCleanupParser(); return true; } @@ -591,3 +590,17 @@ static XMLSharedNodeList* find_impl(xmlXPathContext* ctxt, const string& xpath) return nodes; } +/** Dump a node, its properties and children to a stream */ +void +XMLNode::debug (ostream& s, string p) +{ + s << p << _name << " "; + for (XMLPropertyList::iterator i = _proplist.begin(); i != _proplist.end(); ++i) { + s << (*i)->name() << "=" << (*i)->value() << " "; + } + s << "\n"; + + for (XMLNodeList::iterator i = _children.begin(); i != _children.end(); ++i) { + (*i)->debug (s, p + " "); + } +}