xslt - How to use a variable value -


the variable behaviour here not work expected. have variable named fonttag value html line both start , end tags , divider.

<xsl:variable name="fonttag">     <font face="angsana new" size="12">|</font> </xsl:variable> 

when try use it, part of string back, empty string:

<xsl:value-of select="substring-before($fonttag ,'|')"/> 

where expected substring :

<font face="angsana new" size="12"> 

similarly

<xsl:value-of select="$fonttag"/> 

returns nothing, although

<xsl:copy-of select="$fonttag"/> 

return whole string. there way achieve expected result ?

a derived-question: possible nest xsl select tags (cannot work either)

<xsl:copy-of select="substring-before( <xsl:copy-of select="$fonttag"/>,'|')"/>  

?

thanks

i afraid misunderstand how xslt works. variable not contain string "<font face="angsana new" size="12">|</font>". contains element font, 2 attributes, , string value of "|". xsl:value-of instruction, string function such substring(), address string value of given expression.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -