diff options
author | Adrian Kummerlaender | 2014-06-29 20:36:28 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2014-06-29 20:36:28 +0200 |
commit | bd39d49464dbd17eb3d4cdbb5784431e43e56fbf (patch) | |
tree | 48013d44196637c6ac434c239be1b4950ba7056f /src/support | |
parent | 299d0f6fa3fbd1bfd8d1d6d452e9d055973d0e0e (diff) | |
download | InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.gz InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.bz2 InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.lz InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.xz InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.tar.zst InputXSLT-bd39d49464dbd17eb3d4cdbb5784431e43e56fbf.zip |
Switched FunctionWriteFile content parameter to xalan::XalanNode pointer
* i.e. "write-file" now supports the serialization of given DOM structures
** this will be needed e.g. if FunctionTransform returns the result as a DOM tree instead of as a plain string
** enables the creation of multiple XML documents from within a single transformation
*** i.e. backports the functionality provided in XSLT 2.0 by "xsl:result-document" to xalan's XSLT 1.0
* changed test cases accordingly
Diffstat (limited to 'src/support')
-rw-r--r-- | src/support/type/xobject_value.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/support/type/xobject_value.cc b/src/support/type/xobject_value.cc index 46ce53c..a788e8e 100644 --- a/src/support/type/xobject_value.cc +++ b/src/support/type/xobject_value.cc @@ -46,25 +46,35 @@ xalan::XObjectPtr XObjectValue::get<xalan::XObjectPtr>( } template <> -xalan::XSLTInputSource XObjectValue::get<xalan::XSLTInputSource>( +xalan::XalanNode* XObjectValue::get<xalan::XalanNode*>( const xalan::XObjectPtr& ptr) const { switch ( ptr->getType() ) { case xalan::XObject::eObjectType::eTypeNodeSet: { - return xalan::XSLTInputSource( - ptr->nodeset().item(0) - ); + return ptr->nodeset().item(0); } case xalan::XObject::eObjectType::eTypeResultTreeFrag: { - return xalan::XSLTInputSource( - ptr->rtree().getFirstChild() - ); + return ptr->rtree().getFirstChild(); } default: { - return xalan::XSLTInputSource( - this->get<boost::filesystem::path>(ptr).string().data() - ); + return nullptr; } } } +template <> +xalan::XSLTInputSource XObjectValue::get<xalan::XSLTInputSource>( + const xalan::XObjectPtr& ptr) const { + xalan::XalanNode* const node( + this->get<xalan::XalanNode*>(ptr) + ); + + if ( node == nullptr ) { + return xalan::XSLTInputSource( + this->get<boost::filesystem::path>(ptr).string().data() + ); + } else { + return xalan::XSLTInputSource(node); + } +} + } |