tcanny
12-26-2002, 05:16 PM
In the script below I'm getting the Invalid procedure call or argument error and though I have the feeling this is a simple fix that is staring me in the face I can't for the life of me figure out what I'm doing wrong.
The line of code it errors on looks like this:
xml.load(xmlpath);
However if I replace the xmlpath variable with the document name like this ("document.xml") it combines the two files correctly. and displays them.
The complete page which is using the CSJSRequestObject.js to pull info from the URL search string and the msxml2.dll to combine an XML and an XSL file is as follows:
<html>
<body>
<script src="CSJSRequestObject.js" type="text/javascript" language="JavaScript"></script>
<script type="text/javascript" language="JavaScript"><!--
var xmlpath = Request.QueryString("xmlpath");
//-->
</script>
<script language="JavaScript" type="text/javascript">
// Load XML
var xml = new ActiveXObject("MSXML2.DOMDocument");
xml.async = false;
xml.load(xmlpath); <<This is where I'm getting the Invalid procedure call or argument error.
// Load the XSL
var xsl = new ActiveXObject("MSXML2.DOMDocument");
xsl.async = false;
xsl.load("template.xsl");
// Transform
document.write(xml.transformNode(xsl));
</script>
</body>
</html>
The line of code it errors on looks like this:
xml.load(xmlpath);
However if I replace the xmlpath variable with the document name like this ("document.xml") it combines the two files correctly. and displays them.
The complete page which is using the CSJSRequestObject.js to pull info from the URL search string and the msxml2.dll to combine an XML and an XSL file is as follows:
<html>
<body>
<script src="CSJSRequestObject.js" type="text/javascript" language="JavaScript"></script>
<script type="text/javascript" language="JavaScript"><!--
var xmlpath = Request.QueryString("xmlpath");
//-->
</script>
<script language="JavaScript" type="text/javascript">
// Load XML
var xml = new ActiveXObject("MSXML2.DOMDocument");
xml.async = false;
xml.load(xmlpath); <<This is where I'm getting the Invalid procedure call or argument error.
// Load the XSL
var xsl = new ActiveXObject("MSXML2.DOMDocument");
xsl.async = false;
xsl.load("template.xsl");
// Transform
document.write(xml.transformNode(xsl));
</script>
</body>
</html>