Features: p:directory-lists3-collector,

p:directory-list (S3) 041 (AB)

Tests p:directory-list: override-content-types

Test is expected to pass.

The pipeline

<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
   <p:output port="result"/>
   <p:directory-list path="s3://xmlcalabash-mock1/testfolder"
                     detailed="true" max-depth="unbounded"
                     override-content-types="[['file1\.txt$','application/octet-stream'],                                      ['file2\.txt$' ,'image/png']]"/>
</p:declare-step>

Result

<c:directory xmlns:c="http://www.w3.org/ns/xproc-step"
             xmlns:t="http://xproc.org/ns/testsuite/3.0" name="testfolder"
             xml:base="s3://xmlcalabash-mock1/testfolder/">
   <c:file name="file1.txt" xml:base="file1.txt"
           content-type="application/octet-stream" last-modified="2026-11-21T15:03:46Z"
           etag='"d41d8cd98f00b204e9800998ecf8427e"' size="0" storage-class="STANDARD"/>
   <c:directory name="dir" xml:base="dir/">
      <c:file name="file2.txt" xml:base="file2.txt"
              content-type="image/png" last-modified="2026-11-21T15:03:47Z"
              etag='"d41d8cd98f00b204e9800998ecf8427e"' size="0" storage-class="STANDARD"/>
   </c:directory>
</c:directory>

Filesystem environment

DirectoryPermFilenameLast-modifiedSizeEncodingContents (abbreviated)
  .rwxfile1.txt0
  .rwxdir/file2.txt0

Schematron checks

<s:schema xmlns="http://www.w3.org/1999/xhtml"
          xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
          queryBinding="xslt2">
   <s:ns uri="http://www.w3.org/ns/xproc-step"
         prefix="c"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="c:directory">Root element is not c:directory.</s:assert>
         <s:assert test="c:directory/@name='testfolder'">Root does not have attribute 'name' with 'testfolder'.</s:assert>
         <s:assert test="count(c:directory//c:file)=2">Only two file elements should be present.</s:assert>
         <s:assert test="c:directory/c:file/@name='file1.txt'">There is no file element with @name = 'file1.txt'.</s:assert>
         <s:assert test="//c:file[@name='file1.txt']/@content-type='application/octet-stream'">Content-type of 'file1.txt' is not 'application/octet-stream'.</s:assert>
         <s:assert test="//c:file[@name='file2.txt']/@content-type='image/png'">Content-type of 'file2.txt' is not 'image/png'.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

25 Oct 2026, Norm Tovey-Walsh
Transformed mechanically from ab-directory-list-041.xml