use xmlpp::Document instead of xmlpp::DomParser (the parser is not needed because we do not parse) v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 30 Dec 2020 10:33:24 +0100
branchv_0
changeset 6 e498b3466342
parent 5 682c378bc4a2
child 7 7f2d09c3b1de
use xmlpp::Document instead of xmlpp::DomParser (the parser is not needed because we do not parse)
src/XPathHandler.h
--- a/src/XPathHandler.h	Wed Dec 30 10:03:21 2020 +0100
+++ b/src/XPathHandler.h	Wed Dec 30 10:33:24 2020 +0100
@@ -53,7 +53,7 @@
 
 
 	xmlpp::Node::PrefixNsMap xmlns;
-	xmlpp::DomParser dom;
+	xmlpp::Document dom;
 	xmlpp::Element* recordElement = nullptr;
 	relpipe::in::xmltable::XMLNameCodec xmlNameCodec; // TODO: move to a common library
 
@@ -71,8 +71,8 @@
 	}
 
 	void resetRecordElement() {
-		if (recordElement) dom.get_document()->get_root_node()->remove_child(recordElement);
-		recordElement = dom.get_document()->get_root_node()->add_child("record");
+		if (recordElement) dom.get_root_node()->remove_child(recordElement);
+		recordElement = dom.get_root_node()->add_child("record");
 	}
 
 	const Glib::ustring s2x(relpipe::common::type::StringX value) {
@@ -134,8 +134,8 @@
 			for (auto oa : currentRelationConfiguration->outputAttributes) currentWriterMetadata.push_back({oa.name, oa.type});
 			if (isAppendingInputAttributes()) copyInputAttributesToOutput();
 
-			dom.get_document()->create_root_node("relpipe-tr-xpath");
-			dom.get_document()->get_root_node()->add_child("relation-name")->add_child_text(s2x(name));
+			dom.create_root_node("relpipe-tr-xpath");
+			dom.get_root_node()->add_child("relation-name")->add_child_text(s2x(name));
 			resetRecordElement();
 		}