[Home] [By Thread] [By Date] [Recent Entries]
Alice,
When you define image_src variable, there is a context there (The context is not in graphic element aparently). If there is not an url attribute for current element, you will get empty when you say <xsl:value-of select="./@url"/>. So the result is 0. If you change your program to: <xsl:template match="graphic"> <xsl:value-of select="string-length(@url)"/> </xsl:template> OR: <xsl:template match="graphic">
<xsl:variable name="image_src">
<xsl:value-of select="./@url"/>
</xsl:variable>
<xsl:value-of select="string-length($image_src)"/>
</xsl:template>It should work. Hope this helps. Jingjun Alice Wei ei: Hi,
|

Cart



