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

Variables in attribute expressions - version of standa

Subject: Variables in attribute expressions - version of standard?
From: Bob Purvy <bpurvy@xxxxxxxxxxxxx>
Date: Thu, 17 Oct 2002 10:57:11 -0700
msxml2.domdocument.4.0 attributes
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="/">
   <html>
   <body>
   <xsl:apply-templates />
   </body>
   </html>
</xsl:template>

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

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");
   srcTree.async=false;
   srcTree.load("test1.xml");

   var xsltTree= new ActiveXObject("Msxml2.DOMDocument.4.0");
   xsltTree.async = false;
   xsltTree.load("rmanage.xsl");
   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

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.