Subject: RE: using variable's value in select statement
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 27 Apr 2001 21:28:47 +0100
|
You need the xx:evaluate() function which is present in a number of products
including Saxon and Xalan.
Mike Kay
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Edward
> Kennedy
> Sent: 27 April 2001 20:57
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: using variable's value in select statement
>
>
>
> 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
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- Re: xsl] XSL and XMLSchema with "xsd:", (continued)
- Francis Norton - Fri, 27 Apr 2001 16:49:35 -0400 (EDT)
- David Carlisle - Fri, 27 Apr 2001 14:22:21 -0400 (EDT)
- Michael Kay - Fri, 27 Apr 2001 15:24:34 -0400 (EDT)
- Edward Kennedy - Fri, 27 Apr 2001 15:55:39 -0400 (EDT)
- Michael Kay - Fri, 27 Apr 2001 16:25:45 -0400 (EDT) <=
- David Carlisle - Fri, 27 Apr 2001 13:41:52 -0400 (EDT)
- Karim Barkati - Fri, 27 Apr 2001 11:26:36 -0400 (EDT)
- Tony Graham - Fri, 27 Apr 2001 12:09:21 -0400 (EDT)
- Francis Norton - Fri, 27 Apr 2001 12:27:19 -0400 (EDT)
|
|