aboutsummaryrefslogtreecommitdiff
path: root/src/support/type
diff options
context:
space:
mode:
Diffstat (limited to 'src/support/type')
-rw-r--r--src/support/type/xobject_value.cc25
-rw-r--r--src/support/type/xobject_value.h17
2 files changed, 42 insertions, 0 deletions
diff --git a/src/support/type/xobject_value.cc b/src/support/type/xobject_value.cc
new file mode 100644
index 0000000..cdeb9c6
--- /dev/null
+++ b/src/support/type/xobject_value.cc
@@ -0,0 +1,25 @@
+#include "xobject_value.h"
+
+#include <boost/algorithm/string.hpp>
+
+#include <string>
+
+#include "support/xalan_string.h"
+
+namespace InputXSLT {
+
+namespace XObjectValue {
+
+template <>
+std::string get<std::string>(const xalan::XObjectPtr& ptr) {
+ return boost::trim_copy(toString(ptr->str()));
+}
+
+template <>
+xalan::XObjectPtr get<xalan::XObjectPtr>(const xalan::XObjectPtr& ptr) {
+ return ptr;
+}
+
+}
+
+}
diff --git a/src/support/type/xobject_value.h b/src/support/type/xobject_value.h
new file mode 100644
index 0000000..bb602a4
--- /dev/null
+++ b/src/support/type/xobject_value.h
@@ -0,0 +1,17 @@
+#ifndef INPUTXSLT_SRC_SUPPORT_TUPLE_XOBJECT_VALUE_H_
+#define INPUTXSLT_SRC_SUPPORT_TUPLE_XOBJECT_VALUE_H_
+
+#include <xalanc/XPath/XObject.hpp>
+
+#include "common.h"
+
+namespace InputXSLT {
+
+namespace XObjectValue {
+ template <typename Type>
+ Type get(const xalan::XObjectPtr&);
+}
+
+}
+
+#endif // INPUTXSLT_SRC_SUPPORT_TUPLE_XOBJECT_VALUE_H_