This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Number comparison vs. string 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]