Tests that merge properties doesn’t merge maps if merge-maps is false.
Test merge-properties-003.xml is expected to pass.
<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/merge-properties.xpl"/>
<p:output port="result"/>
<p:set-properties name="alternate" properties="map{'A': 'alternate', 'B': map{'a':'alternate', 'b': 'alternate'}}">
<p:with-input>
<doc/>
</p:with-input>
</p:set-properties>
<p:set-properties name="original" properties="map{'A': 'original', 'B': map{'a':'original'}}">
<p:with-input>
<doc/>
</p:with-input>
</p:set-properties>
<cx:merge-properties merge-maps="false">
<p:with-input port="alternate" pipe="@alternate"/>
</cx:merge-properties>
<p:cast-content-type content-type="application/xml">
<p:with-input select="p:document-properties(.)"/>
</p:cast-content-type>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="map" uri="http://www.w3.org/2005/xpath-functions"/>
<s:pattern>
<s:rule context="/">
<s:assert test="map:map">The root is wrong.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/map:map">
<s:assert test="map:string[@key='A']='original'">A is not original</s:assert>
<s:assert test="map:map[@key='B']/map:string[@key='a']='original'">B/a is not original</s:assert>
<s:assert test="empty(map:map[@key='B']/map:string[@key='b'])">B/b is present</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Created test.