TransformNode因MSXML 6.0而失败 [英] TransformNode fails with MSXML 6.0

查看:135
本文介绍了TransformNode因MSXML 6.0而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用下面的代码在格式良好的XML上应用转换,但它在MSXML 6.0中失败了。相同的代码适用于MSXSML 3.0。我甚至试图将resolveExternals和AllowXSLTScript属性设置为True但它没有帮助。


var

Hi,

I am trying to apply the transformation on a well formed XML using the below code but it fails with MSXML 6.0. The same code works fine with MSXSML 3.0. I even tried to set the resolveExternals and AllowXSLTScript properties to True but it did not help.

var

 

xsl = < span style ="color:#0000ff; font-size:x-small"> new ActiveXObject( " Msxml2.DOMDocument.6.0" );

xsl.async =

xsl = new ActiveXObject("Msxml2.DOMDocument.6.0");

xsl.async =

false ;

xsl.load(xslFile);
< span style ="color:#0000ff; font-size:x-small">

返回

xsl.load(xslFile);

return

 

strXml.transformNode(xsl);

基本上是'xslFile '正在正确加载到'xsl'对象上,但在应用转换时,会抛出以下错误"参数不正确"。如果我用'3.0'替换'6.0',那么每个标志都可以正常工作。我在我的机器上安装了两个版本的MSXML。

谢谢,
Girish

推荐答案

我遇到了同样的问题,我通过对两个dom对象(XML和XSLT)使用相同的版本来解决它:

I had the same problem and I solved it by using the same version for the two dom objects (XML and XSLT):

如果XML对象定义为Msxml2.DOMDocument,XSLT定义为
Msxml2.DOMDocument.4.0我收到了错误。创建为
Msxml2.DOMDocument.4.0时,转换已正确应用。

希望它有所帮助。

祝福。

 

Roberto

 


这篇关于TransformNode因MSXML 6.0而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆