Tests p:split-sequence
Test ab-split-sequence-008.xml is expected to pass.
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
<p:output port="result"/>
<p:identity name="one">
<p:with-input port="source">
<one/>
</p:with-input>
</p:identity>
<p:identity name="two">
<p:with-input>
<two/>
</p:with-input>
</p:identity>
<p:split-sequence name="splitter" test="/one">
<p:with-input pipe="@one @one @two @two @one"/>
</p:split-sequence>
<p:wrap-sequence name="matched" wrapper="matched">
<p:with-input pipe="matched"/>
</p:wrap-sequence>
<p:wrap-sequence name="not-matched" wrapper="not-matched">
<p:with-input pipe="not-matched@splitter"/>
</p:wrap-sequence>
<p:wrap-sequence wrapper="result">
<p:with-input pipe="@matched @not-matched"/>
</p:wrap-sequence>
</p:declare-step>
<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="result">Root element is not 'result'.</s:assert>
<s:assert test="count(result/matched/*)=3">Element 'matched' does not have three children.</s:assert>
<s:assert test="count(result/matched/one)=3">All children of element 'matched' should be 'one'.</s:assert>
<s:assert test="count(result/not-matched/*)=2">Element 'not-matched' does not have two children.</s:assert>
<s:assert test="count(result/not-matched/two)=2">All children of element 'not-matched' should be 'two'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Added attribute 'queryBinding' to schematron's schema.
Additional tests for p:split-sequence