我应该使用哪个版本的MSXML?

时间:2021-12-26 00:28:56

Seems like this would be a common question, though I could not find it on SO.

这似乎是一个常见的问题,虽然我在SO上找不到它。

Which version of MSXML should I use in my applications, and more importantly, how should I decide?

我应该在我的应用程序中使用哪个版本的MSXML,更重要的是,我该如何决定?

There is MSXML3, 4, 5 and 6.

有MSXML3,4,5和6。

I recently posted some code in calling-wcf-service-by-vbscript that used MSXML v4. AnthonyWJones posted that I shouldn't use 4, but instead 3 or 6, but probably 3. Certainly not v5!

我最近在使用MSXML v4的call-wcf-service-by-vbscript中发布了一些代码。 AnthonyWJones发布我不应该使用4,而是使用3或6,但可能是3.当然不是v5!

Why? I'd like to know more about the criteria for selecting the version of MSXML to use in my apps.

为什么?我想更多地了解选择在我的应用中使用的MSXML版本的标准。

Bonus question: Does anyone have a summary of the differences between the various versions of MSXML over time?

奖金问题:有没有人总结过各种版本的MSXML随时间的差异?


Summary so far:

截至目前的摘要:

  • MSXML6
    Should be first choice. was released in 2006, and includes perf and compliance fixes. Use this if you can. It's good. There are no merge modules; to bundle the MSXML6 runtime with your app, MS suggests packaging the MSXML6 msi file. MSXML6 is an upgrade from MSXML3/4 but does not replace them, because it discontinues some features. You can get the MSI here.
  • MSXML6应该是首选。于2006年发布,包括性能和合规性修复。如果可以,请使用此功能。很好。没有合并模块;为了将MSXML6运行时与您的应用程序捆绑在一起,MS建议打包MSXML6 msi文件。 MSXML6是MSXML3 / 4的升级版,但不会替换它们,因为它会中断某些功能。你可以在这里获得MSI。

  • MSXML3
    Second choice. Most widely deployed version. Originally shipped in March 2000. Actively maintained, no new features. Currently supported, if you are on SP5 (shipped in 2005) or later. SP7 is current (also from 2005).
  • MSXML3第二选择。部署最广泛的版本。最初于2000年3月发货。积极维护,没有新功能。目前支持,如果您使用SP5(2005年发货)或更高版本。 SP7是最新的(也是从2005年开始)。

  • MSXML5
    was released only as part of MS-Office. Currently supported by Microsoft, but only as part of Office, not for building apps. Don't build apps that depend on MSXML5: Verboten.
  • MSXML5仅作为MS-Office的一部分发布。目前由Microsoft支持,但仅作为Office的一部分,而不是用于构建应用程序。不要构建依赖于MSXML5的应用程序:Verboten。

  • MSXML4
    originally shipped? Currently in "maintenance mode". Microsoft is encouraging people to move off MSXML4 to MSXML6. Currently supported if you are on MSXML4SP2 or later, which shipped in 2003. download MSXML4SP2 here. Can be redisributed.
  • MSXML4最初发货?目前处于“维护模式”。微软鼓励人们将MSXML4转移到MSXML6。如果您使用的是2003年发布的MSXML4SP2或更高版本,则目前支持。请在此处下载MSXML4SP2。可以重新分发。

Using the right version of MSXML in Internet Explorer is a good entry on the blog from Microsoft's xmlteam.

在Internet Explorer中使用正确版本的MSXML是微软xmlteam在博客上的一个很好的条目。

5 个解决方案

#1


If you need to support Windows OS versions prior to Win2k, then use MSXML3. Otherwise, use MSXML6.

如果您需要在Win2k之前支持Windows操作系统版本,请使用MSXML3。否则,请使用MSXML6。

MSXML4 is in maintenance mode.
MSXML5 was never actually supported for use outside of MS-Office.

MSXML4处于维护模式。 MSXML5从未实际支持在MS-Office之外使用。

See:

#2


I had to make the same decision in my work a couple of years ago.

几年前我必须在我的工作中做出同样的决定。

The MSDN states that version 6 is the optimal one to use, however they don't provide merge modules in the SDK and you are not allowed to distribute it in your application as you could with version 4. Version 4 was superceded by version 6 and version 5 was specifically for MS Office. Version 3 remains the target version on older machines.

MSDN声明版本6是最佳使用版本,但它们不在SDK中提供合并模块,并且您不允许像在版本4中那样在应用程序中分发它。版本4被版本6取代并且版本5专门用于MS Office。版本3仍然是旧机器上的目标版本。

What I ended up doing was taking a graceful degradation approach and attempting to use 6 first, failing that version 4, then failing that use version 3 (code is C++):

我最终做的是采用优雅的降级方法并尝试首先使用6,失败版本4,然后使用版本3失败(代码是C ++):

inline bool CXMLDocument::CreateXMLDOMFactory(void)
{
    wxMutexLocker lock(sm_mXMLDOMFactory);

    if(!sm_pXMLDOMFactory)
    {
        ::CoGetClassObject(CLSID_DOMDocument60, CLSCTX_ALL, 0, IID_IClassFactory, reinterpret_cast<void **>(&sm_pXMLDOMFactory));
        if(!sm_pXMLDOMFactory)
        {
            ::CoGetClassObject(CLSID_DOMDocument40, CLSCTX_ALL, 0, IID_IClassFactory, reinterpret_cast<void **>(&sm_pXMLDOMFactory));
            if(!sm_pXMLDOMFactory)
                ::CoGetClassObject(CLSID_DOMDocument30, CLSCTX_ALL, 0, IID_IClassFactory, reinterpret_cast<void **>(&sm_pXMLDOMFactory));
        }
    }

    return sm_pXMLDOMFactory != 0;
}

We noticed measurable performance improvements after moving to version 6 from version 4, although you have to explicitly set the NewParser property on the document to get this benefit, e.g.:

从版本4迁移到版本6后,我们注意到了可测量的性能改进,尽管您必须在文档上显式设置NewParser属性才能获得此优势,例如:

pDocument->setProperty(_bstr_t(L"NewParser"), VARIANT_TRUE);

There were also a couple more hoops to jump through when loading documents due to security considerations, remote DTDs and so on. Again, this was done via properties on the document, so it is worth looking up the ProhibitDTD, UseInlineSchema, AllowXsltScript and ServerHTTPRequest properties in the MSDN to see if they apply to your usage.

出于安全考虑,远程DTD等原因,在加载文档时还需要更多的箍。同样,这是通过文档上的属性完成的,因此值得在MSDN中查找ProhibitDTD,UseInlineSchema,AllowXsltScript和ServerHTTPRequest属性,以查看它们是否适用于您的使用情况。

#3


Here's a list of all the versions. There is a decent discussion of the differences on Wikipedia.

这是所有版本的列表。对*的差异进行了不错的讨论。

#4


Seems that MSXML 5 is the only version able to sign digitally a XML. MS site says that even MSXML 6 can't do it so, if you need this feature, seems that MSXML 5 is the only way to go.

似乎MSXML 5是唯一能够以数字方式签署XML的版本。 MS网站说,即使MSXML 6也不能这样做,如果你需要这个功能,似乎MSXML 5是唯一的出路。

http://msdn.microsoft.com/en-us/library/ms761363(VS.85).aspx " This sample code uses features that were implemented in MSXML 5.0 for Microsoft Office Applications. XML digital signatures are not supported in MXSML 6.0 and later"

http://msdn.microsoft.com/en-us/library/ms761363(VS.85).aspx“此示例代码使用MSXML 5.0 for Microsoft Office Applications中实现的功能.MXSML 6.0不支持XML数字签名然后”

#5


I recently created a JS library that tried to degrade gracefully from the latest version to the oldest. I found that MSXML 3.0 is very well supported on most systems. I had wanted to use v. 6.0 when available, but it broke on some IE 8 installations. So, I had to change my code to try v 3.0 first and then v 6.0 and then v 2.0.

我最近创建了一个JS库,试图从最新版本优化到最旧版本。我发现大多数系统都支持MSXML 3.0。我曾经想要使用v.6.0,但它在一些IE 8安装上破了。所以,我不得不改变我的代码,首先尝试v 3.0,然后是v 6.0,然后是v 2.0。

#1


If you need to support Windows OS versions prior to Win2k, then use MSXML3. Otherwise, use MSXML6.

如果您需要在Win2k之前支持Windows操作系统版本,请使用MSXML3。否则,请使用MSXML6。

MSXML4 is in maintenance mode.
MSXML5 was never actually supported for use outside of MS-Office.

MSXML4处于维护模式。 MSXML5从未实际支持在MS-Office之外使用。

See:

#2


I had to make the same decision in my work a couple of years ago.

几年前我必须在我的工作中做出同样的决定。

The MSDN states that version 6 is the optimal one to use, however they don't provide merge modules in the SDK and you are not allowed to distribute it in your application as you could with version 4. Version 4 was superceded by version 6 and version 5 was specifically for MS Office. Version 3 remains the target version on older machines.

MSDN声明版本6是最佳使用版本,但它们不在SDK中提供合并模块,并且您不允许像在版本4中那样在应用程序中分发它。版本4被版本6取代并且版本5专门用于MS Office。版本3仍然是旧机器上的目标版本。

What I ended up doing was taking a graceful degradation approach and attempting to use 6 first, failing that version 4, then failing that use version 3 (code is C++):

我最终做的是采用优雅的降级方法并尝试首先使用6,失败版本4,然后使用版本3失败(代码是C ++):

inline bool CXMLDocument::CreateXMLDOMFactory(void)
{
    wxMutexLocker lock(sm_mXMLDOMFactory);

    if(!sm_pXMLDOMFactory)
    {
        ::CoGetClassObject(CLSID_DOMDocument60, CLSCTX_ALL, 0, IID_IClassFactory, reinterpret_cast<void **>(&sm_pXMLDOMFactory));
        if(!sm_pXMLDOMFactory)
        {
            ::CoGetClassObject(CLSID_DOMDocument40, CLSCTX_ALL, 0, IID_IClassFactory, reinterpret_cast<void **>(&sm_pXMLDOMFactory));
            if(!sm_pXMLDOMFactory)
                ::CoGetClassObject(CLSID_DOMDocument30, CLSCTX_ALL, 0, IID_IClassFactory, reinterpret_cast<void **>(&sm_pXMLDOMFactory));
        }
    }

    return sm_pXMLDOMFactory != 0;
}

We noticed measurable performance improvements after moving to version 6 from version 4, although you have to explicitly set the NewParser property on the document to get this benefit, e.g.:

从版本4迁移到版本6后,我们注意到了可测量的性能改进,尽管您必须在文档上显式设置NewParser属性才能获得此优势,例如:

pDocument->setProperty(_bstr_t(L"NewParser"), VARIANT_TRUE);

There were also a couple more hoops to jump through when loading documents due to security considerations, remote DTDs and so on. Again, this was done via properties on the document, so it is worth looking up the ProhibitDTD, UseInlineSchema, AllowXsltScript and ServerHTTPRequest properties in the MSDN to see if they apply to your usage.

出于安全考虑,远程DTD等原因,在加载文档时还需要更多的箍。同样,这是通过文档上的属性完成的,因此值得在MSDN中查找ProhibitDTD,UseInlineSchema,AllowXsltScript和ServerHTTPRequest属性,以查看它们是否适用于您的使用情况。

#3


Here's a list of all the versions. There is a decent discussion of the differences on Wikipedia.

这是所有版本的列表。对*的差异进行了不错的讨论。

#4


Seems that MSXML 5 is the only version able to sign digitally a XML. MS site says that even MSXML 6 can't do it so, if you need this feature, seems that MSXML 5 is the only way to go.

似乎MSXML 5是唯一能够以数字方式签署XML的版本。 MS网站说,即使MSXML 6也不能这样做,如果你需要这个功能,似乎MSXML 5是唯一的出路。

http://msdn.microsoft.com/en-us/library/ms761363(VS.85).aspx " This sample code uses features that were implemented in MSXML 5.0 for Microsoft Office Applications. XML digital signatures are not supported in MXSML 6.0 and later"

http://msdn.microsoft.com/en-us/library/ms761363(VS.85).aspx“此示例代码使用MSXML 5.0 for Microsoft Office Applications中实现的功能.MXSML 6.0不支持XML数字签名然后”

#5


I recently created a JS library that tried to degrade gracefully from the latest version to the oldest. I found that MSXML 3.0 is very well supported on most systems. I had wanted to use v. 6.0 when available, but it broke on some IE 8 installations. So, I had to change my code to try v 3.0 first and then v 6.0 and then v 2.0.

我最近创建了一个JS库,试图从最新版本优化到最旧版本。我发现大多数系统都支持MSXML 3.0。我曾经想要使用v.6.0,但它在一些IE 8安装上破了。所以,我不得不改变我的代码,首先尝试v 3.0,然后是v 6.0,然后是v 2.0。