Monday, April 28, 2008

Get filename using XSLT


<!-- Get the filename -->
<xsl:variable name="filename" select="tokenize(base-uri(.), '/')[last()]">

<!-- Split the filename using '\.' -->
<xsl:variable name="filenamepart" select="tokenize($filename, '\.')">

<!-- Remove the file extension -->
<xsl:value-of select="$filenamepart[1]"/>

No comments: