Features: psvi-support

nw-psvi-001

Tests that p:validate-with-xml-schema produces PSVI annotations.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:ex="http://example.com/sample"
                xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0"
                xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0" psvi-required="true"
                exclude-inline-prefixes="#all">
   <p:output port="result" sequence="true"/>
   <p:load href="../documents/dated-sample.xml"/>
   <p:validate-with-xml-schema>
      <p:with-input port="schema">
         <p:document href="../documents/sample.xsd"/>
      </p:with-input>
   </p:validate-with-xml-schema>
   <p:identity>
      <p:with-input>
         <result>{/ex:doc/@pubdate/data() instance of xs:date}</result>
      </p:with-input>
   </p:identity>
</p:declare-step>

Result

<result xmlns:t="http://xproc.org/ns/testsuite/3.0">true</result>

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="fn"
         uri="http://www.w3.org/2005/xpath-functions"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="result">The root element is not result.</s:assert>
         <s:assert test="string(.) = 'true'">The result is not “true”.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

26 Dec 2024, Norm Tovey-Walsh
Proposed test.