Define a list variable in xslt



In my xsl transform the filename is passed as a parameter to the stylesheet. I want to do a certain set of actions if it is in a certain filelist. Right now I'm doing it this way;



<xsl:param name="specialFiles" select="'|a.xml|b.xml|'"/>

<xsl:template match="/">
<xsl:choose>
<xsl:when test="contains($specialFiles,concat('|',$FILENAME,'|'))" >
<xsl:apply-templates select="abc" />
</xsl:when>
.....
.....


This works, but quickly becomes messy when the specialFiles list grows. Is there a way to declare it like an array, and lookup quickly?


No comments:

Post a Comment