[xsl] using variable's value in select statement

Subject: [xsl] using variable's value in select statement
From: Edward Kennedy <ekennedy@xxxxxxxxx>
Date: Fri, 27 Apr 2001 15:56:47 -0400
I am using a stylesheet to read a string from an xml file into a
variable.  Now I want to use that string in a select xsl:value-of

XML file 1:

	<?xml version="1.0"?>

XML File 2:

	<?xml version="1.0"?>
		<Func1>value1 + value2</Func1>

In the XSL:

	<xsl:variable name="thisline"><xsl:value-of
select="$funcfile/Functions/Func1" /></xsl:variable>    

This returns a string which is actually a mathematical function acting
on other xml elements

Now I want to take this string(function) and use xsl:value-of to get the
value of the fuction within the xml
so it can be used in other places

	<xsl:variable name="thisfunc"><xsl:value-of select="$thisline"
	<xsl:if test="$thisfunc = sum">
		<xsl:text>The sum is correct</xsl:text>

Hope this makes sense!


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

Current Thread