nw-validate-with-rng-004
Tests the dtd-default-attributes option.
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:add-attribute attribute-name="status"
attribute-value="final">
<p:with-input port="source"
href="../documents/rng-def-attr.xml"/>
</p:add-attribute>
<p:validate-with-relax-ng dtd-attribute-values="true">
<p:with-input port="schema"
href="../documents/rng-def-attr.rnc"/>
</p:validate-with-relax-ng>
</p:declare-step>
Result
<document xmlns:t="http://xproc.org/ns/testsuite/3.0"
status="final">
<para>Nothing to see here.</para>
</document>
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="document">The pipeline root is not “document”.</s:assert>
</s:rule>
<s:rule context="document">
<s:assert test="@status != 'final'">Status attribute is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 06 Dec 2025, Norm Tovey-Walsh
- Initial version