[xsl] Variables in attribute expressions - version of standard?

Subject: [xsl] Variables in attribute expressions - version of standard?
From: Bob Purvy <bpurvy@xxxxxxxxxxxxx>
Date: Thu, 17 Oct 2002 10:57:11 -0700
I find that this stylesheet fragment to allow the $foo parameter to be used to select the 'fred' element with id equal to it:

<xsl:param name="foo" select="'bar'" />

<xsl:template match="/">
   <xsl:apply-templates />

<xsl:template match="//fred[@id = $foo]">
   <xsl:value-of select="baz/name" />

works with Xalan 1.4.0, but trying it in IE 6.0, with the msxml4.0 toolkit, like this:

   srcTree = new ActiveXObject("Msxml2.DOMDocument.4.0");

   var xsltTree= new ActiveXObject("Msxml2.DOMDocument.4.0");
   xsltTree.async = false;
   details.innerHTML = srcTree.transformNode(xsltTree);

gives an error about the use of $foo in match="//class[@id = $foo]">

I also got the same error from Xselerator (from MarrowSoft), version 2.5.7.

I guess an academic question would be "who is correct?", but since our customers will use IE no matter how broken it is, the real question is: is there a way to write this such that it will work everywhere (more or less)?

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread