Features: p-validate-with-xsd

ab-validate-with-xsd-016

Test p:validate-with-xml-schema with importing schemas via namespace.

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" version="3.0">
   <p:input port="source">
      <p:inline content-type="application/xml">
         <a:foo xmlns:a="http://dummy/a">
            <b:bar xmlns:b="http://dummy/b"/>
         </a:foo>
      </p:inline>
   </p:input>
   <p:output port="result"/>
   <p:validate-with-xml-schema name="main">
      <p:with-input port="schema">
         <p:document href="../documents/schema-a.xsd"/>
      </p:with-input>
   </p:validate-with-xml-schema>
</p:declare-step>

Result

<a:foo xmlns:a="http://dummy/a"
       xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <b:bar xmlns:b="http://dummy/b"/>
</a:foo>

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:ns prefix="a" uri="http://dummy/a"/>
   <s:ns prefix="b" uri="http://dummy/b"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="a:foo">The element root is not “a:foo”.</s:assert>
         <s:assert test="a:foo/b:bar">There is no child element b:bar.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen
Added attribute 'queryBinding' to schematron's schema.
03 Jul 2020, Achim Berndzen
Added test