pebble-009

Tests that the cx:pebble step preserves document properties.

Test pebble-009.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" exclude-inline-prefixes="cx" name="main" version="3.0">
   <p:import href="https://xmlcalabash.com/ext/library/pebble.xpl"/>
   <p:output port="result" sequence="true"/>
   <p:set-properties properties="map{&#34;a&#34;: 1, &#34;test&#34;: &#34;pass&#34;}" expand-text="false">
      <p:with-input>
         <doc>
            <greeting>{{ greeting }}</greeting>
         </doc>
      </p:with-input>
   </p:set-properties>
   <cx:pebble strictVariables="true" context="map{'greeting': 'Hello, world.'}"/>
   <p:identity>
      <p:with-input>
         <doc greeting="{/doc/greeting}" pass="{p:document-property(., 'test') = 'pass'}"/>
      </p:with-input>
   </p:identity>
</p:declare-step>

Schematron validation

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="doc/@greeting = 'Hello, world.'">Template failed.</s:assert>
         <s:assert test="doc/@pass = 'true'">Properties failed.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

25 Dec 2025, Norm Tovey-Walsh

Created test.