ab-validate-with-dtd-001
Test DTD validation: doctype-system in step's serialization map.
Test is expected to pass.
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:output port="result"/>
<p:validate-with-dtd serialization="map{'doctype-system' : '../documents/address.dtd'}">
<p:with-input>
<address>
<first>Douglas</first>
<last>Adams</last>
<phone>42</phone>
</address>
</p:with-input>
</p:validate-with-dtd>
</p:declare-step>
Result
<address xmlns:t="http://xproc.org/ns/testsuite/3.0">
<first>Douglas</first>
<last>Adams</last>
<phone>42</phone>
</address>
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:pattern>
<s:rule context="/">
<s:assert test="address">The document is not 'address'.</s:assert>
<s:assert test="address/first">There is no child element 'first'.</s:assert>
<s:assert test="address/first/text() = 'Douglas'">There is no text child in first with 'Douglas'.</s:assert>
<s:assert test="address/last">There is no child element 'last'.</s:assert>
<s:assert test="address/last/text() = 'Adams'">There is no text child in last with 'Adam'.</s:assert>
<s:assert test="address/phone">There is no child element 'phone'.</s:assert>
<s:assert test="address/phone/text() = '42'">There is no text child in phone with '42'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 14 Aug 2024, Achim Berndzen
- Initial check in.