Subject: Re: [xsl] Processing a list of non-xml files in XSLT? From: "dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 12 Aug 2024 15:02:46 -0000 |
<xsl:for-each select=" uri-collection($rawimagecollectionString)" > <xsl:variable name="FILE" select="substring-after(., $rawsrcPath)"/>
<xsl:choose> <xsl:when test="$STRUCTURE//image[@file=$FILE]"> <!--Found <xsl:value-of select="$FILE"/>--> </xsl:when> <xsl:otherwise> <file file="{$FILE}" mode="list"/> </xsl:otherwise> </xsl:choose>
<xsl:variable name="rawimagecollectionString" select="concat($rawsrcPath, 'select=*.(jpg|gif|svg|png)')"/>
On 09/08/2024 23:52, Martin Honnen martin.honnen@xxxxxx wrote:
On 09/08/2024 23:28, dvint@xxxxxxxxx wrote:
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.
Looking at https://www.saxonica.com/html/documentation12/sourcedocs/collections/collection-directories.html, it might help Saxon if you not only provide the file suffix in the select "parameter" behind the question mark but also the content-type for the image file type you are looking at.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Processing a list of non-, Martin Honnen martin | Thread | Aw: Re: [xsl] Processing a list of , Martin Honnen martin |
Re: [xsl] Processing a list of non-, Martin Honnen martin | Date | Aw: Re: [xsl] Processing a list of , Martin Honnen martin |
Month |