Parameters 003

Test parameters-003.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"/>

  <p:identity name="fred">
    <p:with-input port="source">
      <p:inline>
        <doc><p/><p/><p/><p/></doc>
      </p:inline>
    </p:with-input>
  </p:identity>

  <parameters>
    <p:with-option name="parameters" select="map { 'p': count(//p) }">
      <p:pipe step="fred" port="result"/>
    </p:with-option>
  </p:parameters>

</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) = 1">
            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 = 'p' and @value = '4')">
            The c:param is incorrect.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

24 Sep 2017 17:47, Norman Walsh

Port my test suite; add documentation and schemas