This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

variables and substring



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]