p:unwrap 001 (AB)
Tests p:unwrap
Test is expected to pass.
Input: source
<p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="pipeline">
<p:unwrap>
<p:with-option name="match" value="p:unwrap"/>
</p:unwrap>
</p:pipeline>
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="pipeline" version="3.0">
<p:input port="source"/>
<p:output port="result"/>
<p:unwrap match="p:unwrap"/>
</p:declare-step>
Result
<p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" name="pipeline">
<p:with-option name="match" value="p:unwrap"/>
</p:pipeline>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:ns prefix="p" uri="http://www.w3.org/ns/xproc"/>
<s:pattern>
<s:rule context="/">
<s:assert test="/p:pipeline">Root element is not 'p:pipeline'.</s:assert>
<s:assert test="count(/p:pipeline/*)=1">Root element should have exactly one child.</s:assert>
<s:assert test="/p:pipeline/p:with-option">Root element should have child 'p:with-option'.</s:assert>
<s:assert test="/p:pipeline/p:with-option/@name='match'">Element 'p:with-option' should have attribute 'name'='match'.</s:assert>
<s:assert test="/p:pipeline/p:with-option/@value='p:unwrap'">Element 'p:with-option' should have attribute 'value'='p:unwrap'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jun 2021, Achim Berndzen
- Added attribute 'queryBinding' to schematron's schema.
- 16 Jun 2019, Achim Berndzen
- Tests for p:unwrap (Partly ported from 1.0)