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

using variable's value in select statement

Subject: using variable's value in select statement
From: Edward Kennedy <ekennedy@xxxxxxxxx>
Date: Fri, 27 Apr 2001 15:56:47 -0400
using variables in select string
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
statement.

XML file 1:

	<?xml version="1.0"?>
	<Data>
		<value1>1</value1>
		<value2>3</value2>
		<sum>4</sum>
	</Data>

XML File 2:

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

**********
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:variable>
	<xsl:if test="$thisfunc = sum">
		<xsl:text>The sum is correct</xsl:text>
	</xsl:text>

Hope this makes sense!

Thanks


 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.