windows 我应该使用哪个版本的 MSXML?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/951804/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which version of MSXML should I use?
提问by Cheeso
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-vbscriptthat used MSXML v4. AnthonyWJones posted that I shouldn't use 4, but instead 3 or 6, but probably 3. Certainly not v5!
我最近在使用 MSXML v4 的调用-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. - 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. SP7is current (also from 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. - 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.
- MSXML6
应该是首选。于 2006 年发布,包括性能和合规性修复。如果可以,请使用它。很好。没有合并模块;要将 MSXML6 运行时与您的应用程序捆绑在一起,MS 建议打包 MSXML6 msi 文件。MSXML6 是 MSXML3/4 的升级版,但不会取代它们,因为它中止了某些功能。您可以在此处获取 MSI 。 - MSXML3
第二选择。部署最广泛的版本。最初于 2000 年 3 月发货。积极维护,没有新功能。当前支持,如果您使用的是SP5(2005 年发布)或更高版本。SP7是最新的(也是从 2005 年开始的)。 - MSXML5
仅作为 MS-Office 的一部分发布。目前受 Microsoft 支持,但仅作为 Office 的一部分,不用于构建应用程序。不要构建依赖于 MSXML5 的应用程序:Verboten。 - MSXML4
最初提供?目前处于“维护模式”。Microsoft 鼓励人们从 MSXML4 迁移到 MSXML6。如果您使用的是 2003 年发布的 MSXML4SP2 或更高版本,目前支持。在此处下载 MSXML4SP2 。 可以重新分配。
Using the right version of MSXML in Internet Exploreris a good entry on the blog from Microsoft's xmlteam.
在 Internet Explorer 中使用正确版本的 MSXML是Microsoft xmlteam 博客上的一个很好的条目。
采纳答案by Shog9
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:
看:
回答by Phil Booth
I had to make the same decision in my work a couple of years ago.
几年前,我不得不在我的工作中做出同样的决定。
The MSDN statesthat 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 等原因,在加载文档时还有更多的障碍需要跳过。再次,这是通过属性来完成的文件,所以它是值得仰视ProhibitDTD
,UseInlineSchema
,AllowXsltScript
并ServerHTTPRequest
在MSDN属性,看看它们是否适用于您的使用。
回答by WarmBooter
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 中为 Microsoft Office 应用程序实现的功能。MXSML 6.0 不支持 XML 数字签名后来“
回答by JP Alioto
Here's a list of all the versions. There is a decent discussion of the differences on Wikipedia.
这是所有版本的列表。在 Wikipedia上对差异进行了不错的讨论。
回答by Cerebrus
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。