<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-validate-with-schematron-011.xml"
        name="ab-validate-with-schematron-011.xml"
        expected="pass"
        features="p-validate-with-schematron">
   <t:info>
      <t:title>ab-validate-with-schematron-011</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2021-06-10</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added attribute 'queryBinding' to schematron's schema.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2020-01-03</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added explicit request for xvrl because svrl is default now.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2019-08-18</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial publication: Test ported from 1.0 test suite</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Testing schematron validation: invalid doc, but assert-valid=false. Check report port.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
         <p:output port="result"/>
         <p:validate-with-schematron assert-valid="false" report-format="xvrl">
            <p:with-input port="source" href="../documents/docbook-invalid.xml"/>
            <p:with-input port="schema" href="../documents/docbook.sch"/>
         </p:validate-with-schematron>
         <p:count limit="1">
            <p:with-input xmlns:xvrl="http://www.xproc.org/ns/xvrl"
                          pipe="report"
                          select="//xvrl:report"/>
         </p:count>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                queryBinding="xslt2">
         <s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="c:result">Document element is not 'c:result'.</s:assert>
               <s:assert test="c:result/text() != '0'">Text child should not be '0'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-validate-with-schematron-011.xml">
      <c:result xmlns:c="http://www.w3.org/ns/xproc-step">1</c:result>
   </t:result>
</t:test>
