From 716958c6acb77f4f63cc6f99d741fe0a901a25ba Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 8 Jul 2014 14:06:47 +0200 Subject: Added ResultNodeFacade constructor overload for root nodes * the common use case of ResultNodeFacade inside external function implementations is managing the result root node ** this root node can be fetched through the xercesc::DOMDocument instance ** the new alias overload automatically fetches the root node pointer and as such doesn't require a root node parameter * changed external function implementations accordingly --- src/support/dom/result_node_facade.cc | 14 ++++++++++++-- src/support/dom/result_node_facade.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/support/dom') diff --git a/src/support/dom/result_node_facade.cc b/src/support/dom/result_node_facade.cc index 570b4e1..c5829c5 100644 --- a/src/support/dom/result_node_facade.cc +++ b/src/support/dom/result_node_facade.cc @@ -9,8 +9,18 @@ namespace InputXSLT { ResultNodeFacade::ResultNodeFacade( xercesc::DOMDocument* document, - xercesc::DOMNode* node, - const std::string& name + const std::string& name +): + ResultNodeFacade( + document, + document->getDocumentElement(), + name + ) { } + +ResultNodeFacade::ResultNodeFacade( + xercesc::DOMDocument* document, + xercesc::DOMNode* node, + const std::string& name ): dom_document_(document), result_node_( diff --git a/src/support/dom/result_node_facade.h b/src/support/dom/result_node_facade.h index c7e831e..c743f92 100644 --- a/src/support/dom/result_node_facade.h +++ b/src/support/dom/result_node_facade.h @@ -11,11 +11,13 @@ namespace InputXSLT { class ResultNodeFacade { public: + ResultNodeFacade(xercesc::DOMDocument*, const std::string&); ResultNodeFacade( xercesc::DOMDocument*, xercesc::DOMNode*, const std::string& ); + ~ResultNodeFacade(); xercesc::DOMElement* getResultElement(); -- cgit v1.2.3