From b31f9170c2bc2330442070968d3cb334cadb5faa Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 18 Aug 2014 20:11:18 +0200 Subject: Renamed FunctionExternalCommand result root node * this change was implemented to match the naming scheme of all other external functions * updated external text formatter test case accordingly --- src/function/external_command.cc | 12 ++++++------ test/external_text_formatter/transformation.xsl | 14 +++++--------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/function/external_command.cc b/src/function/external_command.cc index bd2bf84..7d91a9a 100644 --- a/src/function/external_command.cc +++ b/src/function/external_command.cc @@ -41,7 +41,7 @@ namespace InputXSLT { DomDocumentCache::document_ptr FunctionExternalCommand::constructDocument( std::string command, - boost::optional stdinText + boost::optional input ) const { DomDocumentCache::document_ptr domDocument( DomDocumentCache::createDocument("content") @@ -56,18 +56,18 @@ DomDocumentCache::document_ptr FunctionExternalCommand::constructDocument( boost::process::launch_shell(command, context) ); - if ( stdinText ) { + if ( input ) { boost::process::postream& inputStream = commandProcess.get_stdin(); - inputStream << *stdinText; + inputStream << *input; inputStream.close(); } boost::process::pistream& outputStream = commandProcess.get_stdout(); boost::process::status status = commandProcess.wait(); - ResultNodeFacade result(domDocument.get(), "output"); - result.setAttribute("command", command); - result.setAttribute("code", std::to_string(status.exit_status())); + ResultNodeFacade result(domDocument.get(), "command"); + result.setAttribute("executed", command); + result.setAttribute("code", std::to_string(status.exit_status())); if ( status.exited() ) { try { diff --git a/test/external_text_formatter/transformation.xsl b/test/external_text_formatter/transformation.xsl index c6f11fc..eb92c46 100644 --- a/test/external_text_formatter/transformation.xsl +++ b/test/external_text_formatter/transformation.xsl @@ -11,15 +11,11 @@ - - - + + - + @@ -31,8 +27,8 @@ - - + + Failure during external text formatting -- cgit v1.2.3