[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL Remove part of a text inside TAG
Hi Buddhi,
Actually I want ONLY to remove a path from this tag, For XSL 1.0 you could use recursive call: <xsl:template match="FontFace"> <xsl:copy> <xsl:call-template name="getBaseName"> <xsl:with-param name="filename" select="."/> </xsl:call-template> </xsl:copy> </xsl:template> <xsl:template name="getBaseName"> <xsl:param name="filename" /> <xsl:if test="not(contains($filename,'\'))"> <xsl:value-of select="$filename"/> </xsl:if> <xsl:if test="contains($filename,'\')"> <xsl:call-template name="getBaseName"> <xsl:with-param name="filename" select="substring-after($filename,'\')"/> </xsl:call-template> </xsl:if> </xsl:template> Alternatively for xsl 2.0 <xsl:template match="FontFace"> <xsl:copy> <xsl:value-of select="tokenize(.,'\\')[count(tokenize(current(),'\\'))]"></xsl:value-of> </xsl:copy> </xsl:template> HTH, Rein
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|