<?xml version="1.0" encoding="UTF-8"?>
<t:test  expected="pass" 
        features="p-validate-with-dtd" 
        xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <t:info>
      <t:title>ab-validate-with-dtd-011</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2024-08-15</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial check in.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Test DTD validation: Detection element needs to be in report for non dtd.</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-dtd serialization="map{'doctype-system' : '../documents/Kanava.png'}" assert-valid="false">
            <p:with-input>
               <p:inline>
                  <address >
                     <first>Douglas</first>
                     <last>Adams</last>
                     <phone>42</phone>
                  </address>
               </p:inline>
            </p:with-input>
         </p:validate-with-dtd>
         <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 uri="http://www.xproc.org/ns/xvrl"
            prefix="xvrl"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="//xvrl:report">There is no xvrl:report element.</s:assert>
               <s:assert test="exists(//xvrl:report//xvrl:detection)">There should be a element 'xvrl:detection'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
</t:test>