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/@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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format