[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

variables and substring

Subject: variables and substring
From: lachance@xxxxxxxxxxxxxxxxx (Francois Lachance)
Date: Sat, 19 Feb 2000 13:54:37 -0500 (EST)
substring from variable
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.