Tests p:os-exec using stdmsgs.jar
Test nw-os-exec-001.xml is expected to pass.
It requires the following features: os-exec.
<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
<p:output port="result"/>
<p:os-exec name="exec" command="java">
<p:with-input>
<p:empty/>
</p:with-input>
<p:with-option name="args" select="('-cp', resolve-uri('../lib/stdmsgs.jar', static-base-uri()), 'com.nwalsh.StandardMessages')"/>
</p:os-exec>
<p:wrap-sequence name="stdout" wrapper="c:stdout"/>
<p:wrap-sequence name="stderr" wrapper="c:stderr">
<p:with-input pipe="error@exec"/>
</p:wrap-sequence>
<p:wrap-sequence wrapper="c:result">
<p:with-input pipe="@stdout @stderr exit-status@exec"/>
</p:wrap-sequence>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
<s:pattern>
<s:rule context="/">
<s:assert test="c:result">The document root is not 'c:result'.</s:assert>
</s:rule>
<s:rule context="/c:result">
<s:assert test="contains(c:stdout, 'Hello from stdout')">Stdout is incorrect.</s:assert>
<s:assert test="contains(c:stderr, 'Hello from stderr')">Stderr is incorrect.</s:assert>
<s:assert test="c:result = '0'">Return code is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Initial commit.