Discussion:
Semantics changed again: MSXML 6 fails on transformNode
(too old to reply)
Thomas
2007-03-10 12:18:37 UTC
Permalink
The following fails with an access denied error:

var xml = WScript.CreateObject("MSXML2.DOMDocument.6.0");
var xsl = WScript.CreateObject("MSXML2.DOMDocument.6.0");
xml.validateOnParse=false;
xsl.validateOnParse=false;
xsl.setProperty("ResolveExternals",true);
//the following property may only be set with msxml 6 but does not
seem to have any effect
xsl.setProperty("AllowXsltScript",true);
xml.load(WScript.Arguments(0));
xsl.load(WScript.Arguments(1));
WScript.Echo( xml.transformNode( xsl.documentElement ));

when I use MSXML2.DOMDocument.3.0 (installed side-by-side) to create
the objects, everything works well. This affects 95 % of the
stylesheets we use.And the complaints are coming in from our Vista
users. One workaround is to recommend installing MSXML 3 in addition,
but we woruld prefer it to work with MSXML 6 just as well without
changing the style sheets.

Thanks for any hint on this issue.

- Thomas
Martin Honnen
2007-03-10 12:43:24 UTC
Permalink
Post by Thomas
var xml = WScript.CreateObject("MSXML2.DOMDocument.6.0");
var xsl = WScript.CreateObject("MSXML2.DOMDocument.6.0");
xml.validateOnParse=false;
xsl.validateOnParse=false;
xsl.setProperty("ResolveExternals",true);
//the following property may only be set with msxml 6 but does not
seem to have any effect
xsl.setProperty("AllowXsltScript",true);
xml.load(WScript.Arguments(0));
xsl.load(WScript.Arguments(1));
WScript.Echo( xml.transformNode( xsl.documentElement ));
I could imagine an access denied error on the load calls (or one of
them) if the user running the script does not have access to the
file(s). Are you sure you get the access denied for the transformNode call?
Or are you importing/including stylesheet modules and the access to them
is denied?
Try setting
xsl.resolveExternals = true;
before you load and transform (although I think
xsl.setProperty("ResolveExternals",true); has the same effect).
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...