p:xquery 006 (AB)

Tests p:xquery

Test ab-xquery-006.xml is expected to pass.

The pipeline


      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
         <p:input port="source"/>
         <p:input port="secondary"/>
         <p:output port="result"/>
         
         <p:xquery>
            <p:with-input port="source">
               <p:pipe step="pipeline" port="source"/>
               <p:pipe step="pipeline" port="secondary"/>
            </p:with-input>
            <p:with-input port="query">
               <c:query xmlns:c="http://www.w3.org/ns/xproc-step">
                  <result>{{collection()}}</result>
               </c:query>        
            </p:with-input>
         </p:xquery>
         
      </p:declare-step>
   
MorganaXProc passing XML Calabash failing

Inputs

port = source


      <document>
         <title>Some Title</title>
         <para>Some paragraph.</para>
      </document>
   

port = secondary


      <document>
         <title>Some Other Title</title>
         <para>Some other paragraph.</para>
       </document>
   

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="result">Root element is not 'result'.</s:assert>
               <s:assert test="count(result/document)=2">Root element does not have 2 children 'document'.</s:assert>
            </s:rule>
            <s:rule context="document[1]">
               <s:assert test="title/text()='Some Title'">Title of document[1] is not 'Some Title'.</s:assert>
               <s:assert test="para/text()='Some paragraph.'">Para of document[1] is not 'Some paragraph.'</s:assert>
            </s:rule>
            <s:rule context="document[2]">
               <s:assert test="title/text()='Some Other Title'">Title of document[2] is not 'Some Other Title'.</s:assert>
               <s:assert test="para/text()='Some other paragraph.'">Para of document[2] is not 'Some other paragraph.'</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

13 Sep 2019, Achim Berndzen

Tests for p:xquery (Partly ported from 1.0)