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

Number comparison vs. string comparison

Subject: Number comparison vs. string comparison
From: Unico Hommes <Unico@xxxxxxxx>
Date: Mon, 23 Apr 2001 16:43:46 +0200
xsl number comparison
Hello everybody,

I have a small question.

I have the following xsl :

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
	<xsl:variable name="var" select="" />
	<xsl:template match="/item">
		<xsl:if test="@id = $var">
			do something
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>

I use the following asp code to preprocess this xsl before applying it to
transform my xml file :

var avariable;
var astring = "astring";
var anumber = 0;

somevariable = astring;
//somevariable = anumber;

var xsl = Server.CreateObject("MSXML2.DOMDocument");

xsl.load(xsl_location);
xsl.selectSingleNode("//xsl:variable[0]/@select/").value = somevariable;

Now the problem is if I use somevariable variable to hold a number my code
will work, but if I try to put a string in there the xsl doesn't even hold
the variable in its $var variable. I tested it trying to print it out from
within my xsl with <xsl:value-of select="$var" />

Am I doing something wrong ?

Thanx,

Unico

 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.