aboutsummaryrefslogtreecommitdiff
path: root/src/support/dom_document_guard.h
blob: decca015c0afea10080d6e024242281da9849c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_GUARD_H_
#define INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_GUARD_H_

#include <xalanc/XercesParserLiaison/XercesParserLiaison.hpp>
#include <xalanc/XercesParserLiaison/XercesDOMSupport.hpp>
#include <xalanc/XalanTransformer/XercesDOMWrapperParsedSource.hpp>

#include <xercesc/dom/DOMDocument.hpp>

#include <string>
#include <memory>

#include "common.h"

namespace InputXSLT {

class DomDocumentGuard {
	public:
		DomDocumentGuard(const std::string&);
		~DomDocumentGuard();

		xercesc::DOMDocument* operator->();
		xalan::XalanDocument* finalize();

	private:
		xalan::XercesParserLiaison parser_;
		xalan::XercesDOMSupport dom_support_;
		XMLCh* root_node_name_;
		xercesc::DOMDocument* const document_;
		std::unique_ptr<xalan::XercesDOMWrapperParsedSource> parsed_source_;

};

}

#endif  // INPUTXSLT_SRC_SUPPORT_DOM_DOCUMENT_GUARD_H_