Tests the flatten mapper.
Test fileset-047.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/fileset.xpl"/>
<p:output port="result" sequence="true"/>
<cx:fileset path="../testfolder/hier">
<p:with-input>
<fileset>
<present target-dir="../testfolder/hier/one" present="both">
<merge-mapper to="d.txt"/>
</present>
</fileset>
</p:with-input>
</cx:fileset>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
<s:pattern>
<s:rule context="/">
<s:assert test="c:directory">The root is wrong.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/c:directory">
<s:assert test="ends-with(@xml:base, '/testfolder/hier/one/')">The base URI is wrong.</s:assert>
<s:assert test="count(c:directory) = 1">The number of directories is wrong.</s:assert>
<s:assert test="c:directory[@name='two']">The one directory is missing</s:assert>
<s:assert test="count(c:file) = 4">The number of files is wrong.</s:assert>
<s:assert test="c:file[@name='a.txt']">The a.txt file is missing</s:assert>
<s:assert test="c:file[@name='b.txt']">The a.txt file is missing</s:assert>
<s:assert test="c:file[@name='c.txt']">The a.txt file is missing</s:assert>
<s:assert test="c:file[@name='d.txt']">The a.txt file is missing</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/c:directory/c:directory">
<s:assert test="@xml:base = 'two/'">The base URI is wrong.</s:assert>
<s:assert test="count(c:directory) = 1">The number of directories is wrong.</s:assert>
<s:assert test="c:directory[@name='three']">The one directory is missing</s:assert>
<s:assert test="count(c:file) = 3">The number of files is wrong.</s:assert>
<s:assert test="c:file[@name='a.txt']">The a.txt file is missing</s:assert>
<s:assert test="c:file[@name='b.txt']">The a.txt file is missing</s:assert>
<s:assert test="c:file[@name='c.txt']">The a.txt file is missing</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/c:directory/c:directory/c:directory">
<s:assert test="@xml:base = 'three/'">The base URI is wrong.</s:assert>
<s:assert test="count(c:directory) = 0">The number of directories is wrong.</s:assert>
<s:assert test="count(c:file) = 4">The number of files is wrong.</s:assert>
<s:assert test="c:file[@name='a.txt']">The a.txt file is missing</s:assert>
<s:assert test="c:file[@name='b.txt']">The b.txt file is missing</s:assert>
<s:assert test="c:file[@name='c.txt']">The c.txt file is missing</s:assert>
<s:assert test="c:file[@name='d.other']">The d.other file is missing</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Created test.