aboutsummaryrefslogtreecommitdiff
path: root/src/function
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-11 20:09:34 +0200
committerAdrian Kummerländer2014-05-11 20:09:34 +0200
commit20fca5978b55606062cdaf4c94dec82f5318a62a (patch)
tree3bd7752f8d914525620ff65a9f0235824f07f1da /src/function
parent0cd17b0afde7fc97584af31dfdfc376ef6906517 (diff)
downloadInputXSLT-20fca5978b55606062cdaf4c94dec82f5318a62a.tar
InputXSLT-20fca5978b55606062cdaf4c94dec82f5318a62a.tar.gz
InputXSLT-20fca5978b55606062cdaf4c94dec82f5318a62a.tar.bz2
InputXSLT-20fca5978b55606062cdaf4c94dec82f5318a62a.tar.lz
InputXSLT-20fca5978b55606062cdaf4c94dec82f5318a62a.tar.xz
InputXSLT-20fca5978b55606062cdaf4c94dec82f5318a62a.tar.zst
InputXSLT-20fca5978b55606062cdaf4c94dec82f5318a62a.zip
Switched internal DomDocumentCache structure to std::stack
* using std::unordered_map for named cache lookups was a nice idea but is not useful when one keeps in mind that: ** we don't want cached external function responses in a situation where we are able to execute transformations inside transformations ** cached responses mean that we can not read a xml file, overwrite it using another transformation and then read it again * the currently available InputXSLT frontend only processes a single transformation anyway, so increased memory requirements should not pose a problem ** if a future frontend should offer batch processing of transformation tasks, one could implement a cache reset method to free memory after a transformation has been processed
Diffstat (limited to 'src/function')
-rw-r--r--src/function/base.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/function/base.h b/src/function/base.h
index c5346c7..fe9f6ff 100644
--- a/src/function/base.h
+++ b/src/function/base.h
@@ -28,33 +28,23 @@ class FunctionBase : public xalan::Function {
) const {
const FilesystemContext fsContext(locator);
- const boost::filesystem::path argumentPath(
- fsContext.resolve(argument->str())
- );
-
- DomDocumentCache::optional_item optionalCachedDocument(
- this->document_cache_->get(argumentPath.string())
- );
-
- if ( !optionalCachedDocument.first ) {
- optionalCachedDocument = this->document_cache_->create(
- argumentPath.string(),
+ xalan::XalanDocument* const domDocument(
+ this->document_cache_->create(
static_cast<Implementation*>(
const_cast<FunctionBase*>(this)
)->constructDocument(
fsContext,
- argumentPath
+ fsContext.resolve(argument->str())
)
- );
- }
+ )
+ );
xalan::XPathExecutionContext::BorrowReturnMutableNodeRefList nodeList(
executionContext
);
nodeList->addNodes(
- *optionalCachedDocument.second->getDocumentElement()
- ->getChildNodes()
+ *domDocument->getDocumentElement()->getChildNodes()
);
return executionContext.getXObjectFactory().createNodeSet(nodeList);