From 1fbf6a39784b57925ab19df579f487a338e22ba5 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 9 Jul 2014 19:59:32 +0200 Subject: Added DomDocumentCache::createDocument overload enabling document naming * previous createDocument method used default name "content" ** this led to problems when using xalan::XalanNode as transformation input ** the parameter-less createDocument overload now creates a unnamed xercesc::DOMDocument * changed external function implementations accordingly --- src/support/dom/document_cache.cc | 8 +++++++- src/support/dom/document_cache.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/support/dom') diff --git a/src/support/dom/document_cache.cc b/src/support/dom/document_cache.cc index 23805b5..c18bf96 100644 --- a/src/support/dom/document_cache.cc +++ b/src/support/dom/document_cache.cc @@ -10,10 +10,16 @@ namespace InputXSLT { auto DomDocumentCache::createDocument() -> document_ptr { + return document_ptr( + xercesc::DOMImplementation::getImplementation()->createDocument() + ); +} + +auto DomDocumentCache::createDocument(const std::string& name) -> document_ptr { return document_ptr( xercesc::DOMImplementation::getImplementation()->createDocument( nullptr, - *XercesStringGuard("content"), + *XercesStringGuard(name), nullptr ) ); diff --git a/src/support/dom/document_cache.h b/src/support/dom/document_cache.h index 3aeb332..f472249 100644 --- a/src/support/dom/document_cache.h +++ b/src/support/dom/document_cache.h @@ -27,6 +27,7 @@ class DomDocumentCache { > document_ptr; static document_ptr createDocument(); + static document_ptr createDocument(const std::string&); DomDocumentCache(); -- cgit v1.2.3