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
Post a Comment