Parameters 001

Test parameters-001.xml is expected to pass.

The pipeline

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0">
  <p:output port="result"/>

  <parameters parameters="map { 'a': 1, 'b': 2 }"/>

</p:declare-step>
MorganaXProc failing XML Calabash passing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns prefix="p" uri="http://www.w3.org/ns/xproc"/>
         <s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
         <s:pattern>
            <s:rule context="/*">
               <s:assert test="self::c:param-set">The pipeline root is not c:param-set.</s:assert>
            </s:rule>
            <s:rule context="c:param-set">
               <s:assert test="empty(*[not(self::c:param)])">
            The c:param-set element contains illegal children.</s:assert>
            </s:rule>
            <s:rule context="c:param-set">
               <s:assert test="count(c:param) = 2">
            The c:param-set element has the wrong number of c:params.</s:assert>
            </s:rule>
            <s:rule context="c:param">
               <s:assert test="(@name = 'a' and @value = '1')                           or (@name = 'b' and @value = '2')">
            The c:param is incorrect.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

11 Oct 2018, Norman Walsh

Fixed syntax of @parameters; maps are always expressions.

24 Sep 2017 17:47, Norman Walsh

Port my test suite; add documentation and schemas