在不使用DOMDocument的情况下返回IXMLDOMNodeList [英] Returning IXMLDOMNodeList without using DOMDocument

查看:120
本文介绍了在不使用DOMDocument的情况下返回IXMLDOMNodeList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我目前正在研究一些遗留VB6 ActiveX对象的问题,这些对象实现了SOAP工具包调用的方法。

I'm currently looking into a problem with some legacy VB6 ActiveX objects that implement methods called by the SOAP toolkit.

它们都返回复杂类型,其返回值为IXMLDOMNodeList。我看到的问题是代码有时会耗尽进程内存,因为代码将整个XML响应加载到DOMDocument对象中并调用
上的SelectNodes来获取IXMLDOMNodeList。如果响应很大(例如,> 70MB),则DOMDocument.LoadXml调用将失败,并且"没有足够的存储空间可用于完成此操作"

They all return complex types, the return value of which is IXMLDOMNodeList. The problem I'm seeing is that the code is sometime exhausting the process memory because the code loads the whole XML response into a DOMDocument object and calls SelectNodes on it to get the IXMLDOMNodeList. If the response is large (say, >70MB), the DOMDocument.LoadXml call fails with "Not enough storage is available to complete this operation"

我想知道的是有一种方法可以构建响应对象,而无需将XML加载到DOMDocument对象中。例如,有没有办法使用SAX解析器返回IXMLDOMNodeList?代码很旧,所以变化越少,
越好!

What I'm wondering is whether there's a way to build the response object without having to load the XML into a DOMDocument object. Is there a way of returning an IXMLDOMNodeList using the SAX parser, for example? The code is very old so the fewer changes, the better!

提前致谢。

推荐答案

使用MSXML,有多种方法可以组合SAX和DOM,请参阅
http://msdn.microsoft.com/en-us/library/ms753803%28v=VS.85%29的.aspx
。这种方法允许您为更大的XML文档的一部分构建DOM树,从而避免为整个文档构建DOM。 
With MSXML there are ways to combine SAX and DOM, see http://msdn.microsoft.com/en-us/library/ms753803%28v=VS.85%29.aspx. That approach allows you to build a DOM tree for parts of a larger XML document, thereby avoiding to build a DOM for the complete document. 


这篇关于在不使用DOMDocument的情况下返回IXMLDOMNodeList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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