variables and substring

Subject: variables and substring
From: lachance@xxxxxxxxxxxxxxxxx (Francois Lachance)
Date: Sat, 19 Feb 2000 13:54:37 -0500 (EST)
Aim: truncate an attribute value

Processor: XT

Example Source: 

<lg> 
<l>The <w n="list1">yellow</w> cab drove away.</l> 
<l>The <w n="list2">green</w> taxi slid to a stop.</l> 
<l>The <w n="list1">red</w> truck halted briefly.</l> 
<l>The <w n="list2">purple</w> van sped away.</l> 
</lg>


XSLT

<xsl:template name="listnum">

<xsl:variable name="N" select="string(@n)"/>

<xsl:value-of select="substring-after('$N','list')"/>

<xsl:text> -- </xsl:text>

</xsl:template>


I tested to see if the variable was being passed
<xsl:value-of select="$N"/>
returns the anticipated  value -- list1, list2

However 
<xsl:value-of select="substring-after('$N','list'"/>
does not return the anticipated value -- 1, 2

Any pointers?

Thanks

-- 
Francois Lachance
Post-doctoral Fellow
projet HYPERLISTES project
http://www.humanities.mcmaster.ca/~hyplist/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread