Name

p:os-exec — The standard p:os-exec step.

Synopsis

The p:os-exec step runs an external command passing the input that arrives on its source port as standard input, reading result from standard output, and error from standard error.

Input portPrimarySequenceContent types
source✔ ✔ any 
Output portPrimarySequenceContent types
result✔ ✔ any 
error  any 
exit-status  application/xml 
Option nameTypeDefault valueRequired
commandxs:string ✔ 
argsxs:string*() 
cwdxs:string?() 
error-content-typexs:string'text/plain' 
failure-thresholdxs:integer?() 
path-separatorxs:string?() 
result-content-typexs:string'text/plain' 
serializationmap(xs:QName,item()*)?() 
Declaration
 1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
   |   <p:input port="source" sequence="true" content-types="any"/>
   |   <p:output port="result"
   |             primary="true"
 5 |             sequence="true"
   |             content-types="any"/>
   |   <p:output port="error" content-types="any"/>
   |   <p:output port="exit-status" content-types="application/xml"/>
   |   <p:option name="command" required="true" as="xs:string"/>
10 |   <p:option name="args" select="()" as="xs:string*"/>
   |   <p:option name="cwd" as="xs:string?"/>
   |   <p:option name="result-content-type" select="'text/plain'" as="xs:string"/>
   |   <p:option name="error-content-type" select="'text/plain'" as="xs:string"/>
   |   <p:option name="path-separator" as="xs:string?"/>
15 |   <p:option name="failure-threshold" as="xs:integer?"/>
   |   <p:option name="serialization" as="map(xs:QName,item()*)?"/>
   |</p:declare-step>
Errors
CodeDescription
err:XC0032It is a dynamic error (err:XC0032) if more than one document appears on the source port of the p:os-exec step.
err:XC0033It is a dynamic error (err:XC0033) if the command cannot be run.
err:XC0034It is a dynamic error (err:XC0034) if the current working directory cannot be changed to the value of the cwd option.
err:XC0063It is a dynamic error (err:XC0063) if the path-separator option is specified and is not exactly one character long.
err:XC0064It is a dynamic error (err:XC0064) if the exit code from the command is greater than the specified failure-threshold value.
Implementation defined features
Implementation dependent features

Description

The p:os-exec step is defined in the XProc 3.1: Standard Step Library. It is also described on XProcRef.org.