pdf-form-001

Tests that pdf-form works.

Test pdf-form-001.xml is expected to pass.

The pipeline

<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0">
   <p:import href="https://xmlcalabash.com/ext/library/pdf-steps.xpl"/>
   <p:output port="result"/>
   <cx:pdf-info form-details="true">
      <p:with-input port="source" href="../documents/libreoffice-form.pdf"/>
   </cx:pdf-info>
</p:declare-step>

Schematron validation

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:ns prefix="cx" uri="http://xmlcalabash.com/ns/extensions"/>
   <s:ns prefix="f" uri="http://xmlcalabash.com/ns/acro-form"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="cx:pdf-info">Wrong document element&gt;</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/cx:pdf-info">
         <s:assert test="exists(f:acro-form)">Form is missing</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="f:acro-form">
         <s:assert test="f:text[@name='First Name'] = 'Alice'">First name is incorrect</s:assert>
         <s:assert test="f:text[@name='Last Name'] = ''">Last name is incorrect</s:assert>
         <s:assert test="f:radiobutton[@name='female'] = 'Off'">Radio button is wrong</s:assert>
         <s:assert test="f:checkbox[@name='gdpr'] = 'Off'">Check box is wrong</s:assert>
         <s:assert test="empty(f:combobox/f:value)">Combobox is wrong</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

12 Jun 2026, Norm Tovey-Walsh

Created test.