Exec
Purpose:
- Allow XSL stylesheets to execute external programs and process results.
Namespace:
urn:WebWorks-XSLT-Extension-Execute
Prefix:
wwexec
Returns:
Exec XML Document Namespace:
urn:WebWorks-XSLT-Extension-Execute
wwexec
- Provides the return code, stdout, and stderr results from the running process.
<wwexec:Result version="1.0" retcode="-1"> <wwexec:Stream name="Output"> Standard output will show up here, aka stdout. </wwexec:Stream> <wwexec:Stream name="Error"> Standard error will show up here, aka stderr. </wwexec:Stream> </wwexec:Result>
Methods:
- Execute(string commandLine):
- Runs the command line using the current target's output directory as the working directory.
Example:
Returns:Execute prettycool.exe --stdout "Isn't this grand?" --stderr nothing.
<xsl:variable name="VarExecResult" select="wwexec:Execute('prettycool.exe --stdout "Isn\'t this grand?" --stderr nothing')" />
ExecuteInDirectory(string directoryPath, string commandLine):
- Runs the command line in the specified working directory.
Example:
Returns:Execute prettycool.exe --stdout "Isn't this grand?" --stderr nothing in the directory C:\workingdir.
<xsl:variable name="VarExecResult" select="wwexec:ExecuteInDirectory('C:\\workingdir', 'prettycool.exe --stdout "Isn\'t this grand?" --stderr nothing')" />
ExecuteProgramWithArguments(string program, string arguments):
- Runs the specified program with arguments formatted as a string using the current target's output directory as the working directory.
Example:
Returns:Execute prettycool.exe --stdout "Isn't this grand?" --stderr nothing.
<xsl:variable name="VarExecResult" select="wwexec:ExecuteProgramWithArguments('prettycool.exe', '--stdout "Isn\'t this grand?" --stderr nothing')" />
ExecuteProgramWithArgumentsInDirectory(string directoryPath, string program, string arguments):
- Runs the specified program with arguments formatted as a string in the specified working directory.
Example:
Returns:Execute prettycool.exe --stdout "Isn't this grand?" --stderr nothing in the directory C:\workingdir.
<xsl:variable name="VarExecResult" select="wwexec:ExecuteProgramWithArgumentsInDirectory('C:\\workingdir', 'prettycool.exe', '--stdout "Isn\'t this grand?" --stderr nothing')" />
ExecuteCommand(string command, string argument1, string argument2, string argument3, string argument4, string argument5, string argument6, string argument7, string argument8, string argument9, string argument10, string argument11, string argument12, string argument13, string argument14, string argument15, string argument16, string argument17, string argument18, string argument19, string argument20):
- Runs the specified program with zero or more arguments using the current target's output directory as the working directory.
Example:
Returns:Execute prettycool.exe --stdout "Isn't this grand?" --stderr nothing.
<xsl:variable name="VarExecResult" select="wwexec:ExecuteCommand('prettycool.exe', '--stdout', 'Isn\'t this grand?', '--stderr', 'nothing')" />
ExecuteCommandInDirectory(string directoryPath, string command, string argument1, string argument2, string argument3, string argument4, string argument5, string argument6, string argument7, string argument8, string argument9, string argument10, string argument11, string argument12, string argument13, string argument14, string argument15, string argument16, string argument17, string argument18, string argument19, string argument20):
- Runs the specified program with zero or more arguments in the specified working directory.
Example:
Returns:Execute prettycool.exe --stdout "Isn't this grand?" --stderr nothing in the directory C:\workingdir.
<xsl:variable name="VarExecResult" select="wwexec:ExecuteCommandInDirectory('C:\\workingdir', 'prettycool.exe', '--stdout', 'Isn\'t this grand?', '--stderr', 'nothing')" />
- Runs the command line using the current target's output directory as the working directory.