blob: 399bccb2245caaa31a9ae72a7aa3efc71543bde5 (
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
37
38
39
40
41
42
43
44
45
46
|
#include "stylesheet_parameter_guard.h"
namespace InputXSLT {
StylesheetParameterGuard::StylesheetParameterGuard(
xalan::XalanTransformer& transformer
): transformer_(transformer) { }
StylesheetParameterGuard::StylesheetParameterGuard(
xalan::XalanTransformer& transformer,
const map& parameters
): transformer_(transformer) {
this->set(parameters);
}
StylesheetParameterGuard::~StylesheetParameterGuard() {
this->transformer_.clearStylesheetParams();
}
void StylesheetParameterGuard::set(const map& parameters) {
for ( auto&& parameter : parameters ) {
this->set(parameter.first, parameter.second);
}
}
void StylesheetParameterGuard::set(
const std::string& key,
const std::string& value
) {
this->transformer_.setStylesheetParam(
key.data(),
std::string("'" + value + "'").data()
);
}
void StylesheetParameterGuard::set(
const std::string& key,
const xalan::XObjectPtr& value
) {
this->transformer_.setStylesheetParam(
key.data(),
value
);
}
}
|