Features: p-validate-with-schematron

ab-validate-with-schematron-001

Testing schematron validation: result should be equal to source.

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-schematron>
      <p:with-input port="source"
                    href="../documents/docbook-valid.xml"/>
      <p:with-input port="schema"
                    href="../documents/docbook.sch"/>
   </p:validate-with-schematron>
</p:declare-step>

Result

<book xmlns="http://docbook.org/ns/docbook"
      xmlns:t="http://xproc.org/ns/testsuite/3.0" xmlns:xlink="http://www.w3.org/1999/xlink"
      version="5.0">
   <title>Valid Book</title>
   <chapter xml:id="ch1">
      <title>XML?</title>
      <para>This is a story about <biblioref linkend="xml10"/> and
<biblioref linkend="xml11"/>. We explicitly reference
<biblioref linkend="xmlns10"/> and we explicitly don't reference
<citetitle>Namespaces in XML 1.1</citetitle>.</para>
   </chapter>
   <bibliography>
      <bibliomixed xml:id="xml10">
         <abbrev>XML 1.0</abbrev>
         <citetitle xlink:href="http://www.w3.org/TR/REC-xml/">Extensible
Markup Language (XML) 1.0 (Fourth Edition)</citetitle>. Tim Bray,
Jean Paoli, C. M. Sperberg-McQueen, et. al.
editors. W3C Recommendation 16 August 2006.</bibliomixed>
      <bibliomixed xml:id="xmlns10">
         <abbrev>Namespaces 1.0</abbrev>
         <citetitle xlink:href="http://www.w3.org/TR/REC-xml-names/">Namespaces
in XML 1.0 (Second Edition)</citetitle>. Tim Bray,
Dave Hollander, Andrew Layman, et. al.,
editors. W3C Recommendation 16 August 2006.</bibliomixed>
      <bibliomixed xml:id="xml11">
         <abbrev>XML 1.1</abbrev>
         <citetitle xlink:href="http://www.w3.org/TR/xml11/">Extensible
Markup Language (XML) 1.1 (Second Edition)</citetitle>. Tim Bray,
Jean Paoli, C. M. Sperberg-McQueen, et. al.
editors. W3C Recommendation 16 August 2006.</bibliomixed>
      <bibliomixed xml:id="xmlns11">
         <abbrev>Namespaces 1.1</abbrev>
         <citetitle xlink:href="http://www.w3.org/TR/xml-names11/">Namespaces
in XML 1.1 (Second Edition)</citetitle>. Tim Bray,
Dave Hollander, Andrew Layman, et. al.,
editors. W3C Recommendation 16 August 2006.</bibliomixed>
   </bibliography>
</book>

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="deep-equal(., doc('../documents/docbook-valid.xml'))">The document is not equal to the source document.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen
Added attribute 'queryBinding' to schematron's schema.
18 Aug 2019, Achim Berndzen
Initial publication: Test ported from 1.0 test suite