<?xml version="1.0" encoding="UTF-8"?>
<t:test expected="pass" 
        features="p-validate-with-nvdl"
        xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <t:info>
      <t:title>ab-validate-with-nvdl-006</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2022-09-20</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial commit.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Testing nvdl validation: Invalid document with assert-valid="false". Explicit XVRL on port result.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step name="pipeline"
                      version="3.0"
                      xmlns:p="http://www.w3.org/ns/xproc">
         <p:output port="result"/>
         <p:validate-with-nvdl assert-valid="false" report-format="xvrl">
            <p:with-input port="source"
                          href="../documents/NDVL-Book-invalid.xml"/>
            <p:with-input port="nvdl"
                          href="../documents/NVDL.nvdl"/>
         </p:validate-with-nvdl>
         
         <p:identity>
            <p:with-input pipe="report" />
         </p:identity>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema queryBinding="xslt2"
         xmlns:s="http://purl.oclc.org/dsdl/schematron"
         xmlns="http://www.w3.org/1999/xhtml">
         <s:ns prefix="xvrl" uri="http://www.xproc.org/ns/xvrl" />
         <s:pattern>   
            <s:rule context="/">
               <s:assert test="xvrl:report">The report port does not hold xvrl error report.</s:assert>
               <s:assert test="xvrl:report//xvrl:detection">There is no detection element.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
</t:test>