From 0b611b7bd28851fe8096b3d2c121c68e231ada11 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Sat, 26 Apr 2014 11:21:10 +0200 Subject: Implemented global DOM document cache * the plan to return XML-nodes from each external function requires a better way to manage the lifetime of many xerces DOM document instances and their support class instances ** this is why DomDocumentCache and DomDocumentCache::item were implemented ** based on std::map so we can easily access the result of old function calls * changed external read-directory function to return the children of the document node instead of the document node itself ** removes unnecessary cruft in function calls ** will make returning status codes alongside the function result more pleasing to the eye * updated test transformation to reflect new features --- src/support/utility.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/support/utility.h (limited to 'src/support/utility.h') diff --git a/src/support/utility.h b/src/support/utility.h new file mode 100644 index 0000000..4c63c72 --- /dev/null +++ b/src/support/utility.h @@ -0,0 +1,18 @@ +#ifndef INPUTXSLT_SRC_SUPPORT_UTILITY_H_ +#define INPUTXSLT_SRC_SUPPORT_UTILITY_H_ + +namespace { + +inline std::string xalanToString(const xalan::XalanDOMString& text) { + xalan::CharVectorType castHelper; + text.transcode(castHelper); + + return std::string( + castHelper.begin(), + castHelper.end() - 1 + ); +} + +} + +#endif // INPUTXSLT_SRC_SUPPORT_UTILITY_H_ -- cgit v1.2.3