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

evaluate() error variable has not been declared??

Subject: evaluate() error variable has not been declared??
From: "davidpbrown" <lists@xxxxxxxxxxxxxxxxx>
Date: Mon, 10 May 2004 20:17:26 +0100
has not been declared
<newbie/>
I had expected saxon:evaluate() to be simple but it has me stumped.

Why does the following test give error suggesting "Variable $test has not
been declared", when it obviously has?

<?xml version="1.0" encoding="utf-8"?>
<test>
<input>result</input>
<result>expected output!</result>
</test>

<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0" xmlns:saxon="http://saxon.sf.net/"
extension-element-prefixes="saxon">
<xsl:output method="xml" indent="no" encoding="utf-8"/>

<xsl:template match="/">
 <xsl:variable name="test" select="/test/input/text()"/>
 <xsl:value-of select="$test"/>
 <xsl:if test="$test != ''">
  <xsl:variable name="output"
select="saxon:evaluate('/test/$test/text()')"/>
  <xsl:value-of select="$output"/>
  <trace/>
 </xsl:if>
</xsl:template>

<xsl:template match="text()|@*"/>
</xsl:transform>

Without the <if>, $test has been defined and is output ok.

Regards
davidpbrown

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.