diff options
-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 | ||||
-rw-r--r-- | test/external_text_formatter/transformation.xsl | 2 |
4 files changed, 9 insertions, 11 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, diff --git a/test/external_text_formatter/transformation.xsl b/test/external_text_formatter/transformation.xsl index f797b87..aa9a300 100644 --- a/test/external_text_formatter/transformation.xsl +++ b/test/external_text_formatter/transformation.xsl @@ -25,7 +25,7 @@ <xsl:template name="implementation"> <xsl:variable name="result"> <xsl:call-template name="formatter"> - <xsl:with-param name="format">/usr/bin/markdown</xsl:with-param> + <xsl:with-param name="format">markdown</xsl:with-param> <xsl:with-param name="file">[test.md]</xsl:with-param> </xsl:call-template> </xsl:variable> |