cx-until-001

Test cx:until

Test cx-until-001.xml is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
   <p:output port="result"/>
   <cx:until test="xs:integer(/doc/@count) gt 5">
      <p:with-input>
         <doc count="3"/>
      </p:with-input>
      <p:add-attribute attribute-name="count" attribute-value="{xs:integer(/doc/@count) + 1}"/>
   </cx:until>
</p:declare-step>

Schematron validation

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:ns prefix="fn" uri="http://www.w3.org/2005/xpath-functions"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="doc">The result isn’t doc.</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/doc">
         <s:assert test="@count = 6">The count is wrong.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

18 Jan 2025, Norm Tovey-Walsh

Created test.