diff options
Diffstat (limited to 'src/function')
-rw-r--r-- | src/function/external_text_formatter.cc | 12 | ||||
-rw-r--r-- | src/function/external_text_formatter.h | 4 | ||||
-rw-r--r-- | src/function/generate.cc | 2 |
3 files changed, 8 insertions, 10 deletions
diff --git a/src/function/external_text_formatter.cc b/src/function/external_text_formatter.cc index 048f81a..03902e9 100644 --- a/src/function/external_text_formatter.cc +++ b/src/function/external_text_formatter.cc @@ -40,21 +40,21 @@ inline xercesc::DOMNode* importDocumentElement( namespace InputXSLT { DomDocumentCache::document_ptr FunctionExternalTextFormatter::constructDocument( - boost::filesystem::path formatterPath, - std::string stdinText + std::string formatterCommand, + std::string stdinText ) const { DomDocumentCache::document_ptr domDocument( DomDocumentCache::createDocument("content") ); boost::process::context context; + context.environment = boost::process::self::get_environment(); context.stdout_behavior = boost::process::capture_stream(); context.stdin_behavior = boost::process::capture_stream(); boost::process::child formatterProcess( - boost::process::launch( - formatterPath, - std::vector<std::string>{""}, + boost::process::launch_shell( + formatterCommand, context ) ); @@ -68,7 +68,7 @@ DomDocumentCache::document_ptr FunctionExternalTextFormatter::constructDocument( boost::process::status status = formatterProcess.wait(); ResultNodeFacade result(domDocument.get(), "output"); - result.setAttribute("formatter", formatterPath.filename().string()); + result.setAttribute("formatter", formatterCommand); result.setAttribute("code", std::to_string(status.exit_status())); if ( status.exited() ) { diff --git a/src/function/external_text_formatter.h b/src/function/external_text_formatter.h index 27f2fc7..4788784 100644 --- a/src/function/external_text_formatter.h +++ b/src/function/external_text_formatter.h @@ -9,7 +9,7 @@ namespace InputXSLT { class FunctionExternalTextFormatter : public FunctionBase< FunctionExternalTextFormatter, - boost::filesystem::path, + std::string, std::string > { public: @@ -19,7 +19,7 @@ class FunctionExternalTextFormatter : public FunctionBase< friend FunctionBase; DomDocumentCache::document_ptr constructDocument( - boost::filesystem::path, + std::string, std::string ) const; diff --git a/src/function/generate.cc b/src/function/generate.cc index 0c5c664..df5e65b 100644 --- a/src/function/generate.cc +++ b/src/function/generate.cc @@ -37,8 +37,6 @@ DomDocumentCache::document_ptr FunctionGenerate::constructDocument( xalan::XalanOutputStreamPrintWriter writer(output); xalan::FormatterToXML targetFormatter(writer); - targetFormatter.setDoIndent(true); - transformer.generate( inputSource, transformationSource, |