This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Problem using transformNode in html transformed from XML
- From: "Steve Renshaw" <renshaw_steve at hotmail dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 20 Mar 2002 20:32:05 +0000
- Subject: [xsl] Problem using transformNode in html transformed from XML
- Reply-to: xsl-list at lists dot mulberrytech dot com
I have doc.xm and doc.xsl that generates html output.
Within the generated html output, there a javascript
function "Change()" that executes when a certain form
element has an onChange event.
Within Change() I attempt to load Bug.xml and Bug.xsl,
do the transform using transformNode and stuff the
result into <div id="here">: The generated code within
the html output looks like this:
<html>
<head>
<script type="text/javascript">
<![CDATA[
function Change() {
var objPathXml="Bug.xml";
objXml= new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
objXml.async =false;
objXml.validateOnParse = false;
objXml.load(objPathXml);
var objPathXsl="Bug.xsl";
objXsl= new ActiveXObject('Microsoft.XMLDom');
objXsl.async =false;
objXsl.validateOnParse = false;
objXsl.load(objPathXsl);
document.all['here'].innerHTML =
objXml.transformNode(objXsl.documentElement);
return;
}
]]>
</script>
</head>
<body>
<div id="here"></div>
</body>
</html>
My problem is that I consistently get the error message:
"Invalid procedure call or argument"
on the line that contains "document.all['here'].innerHTML".
I realize there is a lot going on in this example, but if
I change the last line to:
document.all['here'].innerHTML ="<b>Hello World</b>";
then "Hello World" shows up in bold at <div id="here">
when the form element is changed. The only thing that
does not appear to be working is the transformNode.
Any ideas what is going wrong?
I am using IE6 and doing client side XSLT.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list