Re: [xsl] Processing a list of non-xml files in XSLT?

Subject: Re: [xsl] Processing a list of non-xml files in XSLT?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 9 Aug 2024 21:51:50 -0000
On 09/08/2024 23:28, dvint@xxxxxxxxx wrote:
I've created a conversion process to take DITA to asciidoc that works
pretty well overall. What I have is:
- a folder with all the dita, ditamaps, and images in a flat structure
- a simplified format of the map as run through the normalize process

I use the simplified map to determine what files and how they should
be organized in the final output. This map also contains information
about images, xrefs and conref content (linked to content).

My problem is that the simplified map is based upon files that are in
the TOC. We have some situations where the writer has referenced
topics that are not in the TOC.

I want to run a list of all the dita files as a collection and another
list of images as a collection so I can compare these to the entries
in the map. The process works well for the dita content with this:



I'm shifting to the images and tried to use the same configuration for
images. Problem is that base-uri() wants an XML file

The required item type of the first argument of fn:base-uri() is
node(); the supplied value xs:base64Binary("") is an atomic value

Is there anything I can use directly in XSL (this one stylesheet) that
will just give me the filenames of these images? I can do some other
preprocessing stages and build an xml file with all these images
listed, but I would prefer to do this in this one stylesheet that is
doing all of this heavy lifting and decision making.



XSLT 3/XPath 3 has a function uri-collection and I think with Saxon if
you use that function with e.g. ?select=(*.jpg|*.png) it gives you a
sequence of file URIs to the files without the need to process the
binary file contents.

Current Thread