Gibt es eine Möglichkeit, Dateinamen in XSLT (für Funktion?) Zu durchlaufen?Für x Funktion in XSLT?
Ich möchte überprüfen, ob die Datei von _001.jpg existiert ... bis ... _005.jpg
Zur Zeit kann ich eine Datei überprüfen:
<xsl:stylesheet exclude-result-prefixes="xs fs" version="2.0" xmlns:fs="java.io.File" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output cdata-section-elements="DESCRIPTION" indent="yes" method="xml"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="product">
<xsl:apply-templates/>
<xsl:variable name="imageproductid" select="code"/>
<xsl:choose>
<xsl:when test="fs:exists(fs:new(concat('/images/',$imageproductid,'_001.jpg')))">
<IMAGE1>
<xsl:value-of select="concat('/images/',$imageproductid,'_001.jpg')"/>
</IMAGE1>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
wo <IMAGE1>
Tag <IMAGE1>,<IMAGE2>,<IMAGE3>,<IMAGE4>,<IMAGE5>
sein sollte
Ich benutze Saxon 9.1, XSLT 2.0.
Das ist perfekt: schnell und einfach. – Adrian