diff options
Diffstat (limited to 'src/support')
-rw-r--r-- | src/support/type/xobject_value.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/support/type/xobject_value.cc b/src/support/type/xobject_value.cc index cdeb9c6..812be52 100644 --- a/src/support/type/xobject_value.cc +++ b/src/support/type/xobject_value.cc @@ -1,5 +1,8 @@ #include "xobject_value.h" +#include <xalanc/XSLT/XSLTInputSource.hpp> +#include <xalanc/XalanDOM/XalanDocumentFragment.hpp> + #include <boost/algorithm/string.hpp> #include <string> @@ -20,6 +23,22 @@ xalan::XObjectPtr get<xalan::XObjectPtr>(const xalan::XObjectPtr& ptr) { return ptr; } +template <> +xalan::XSLTInputSource get<xalan::XSLTInputSource>( + const xalan::XObjectPtr& ptr) { + switch ( ptr->getType() ) { + case xalan::XObject::eObjectType::eTypeNodeSet: { + return xalan::XSLTInputSource(ptr->nodeset().item(0)); + } + case xalan::XObject::eObjectType::eTypeResultTreeFrag: { + return xalan::XSLTInputSource(ptr->rtree().getFirstChild()); + } + default: { + return xalan::XSLTInputSource(ptr->str()); + } + } +} + } } |