创建一个编辑器来编辑大型xml文件 [英] create an editor to edit large xml files

查看:186
本文介绍了创建一个编辑器来编辑大型xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个文本框来加载xml文件并让用户对其进行编辑.但是,由于文件可能很大,因此无法使用XmlDocument进行加载.我正在寻找以流方式/分块加载xml文档的选项,这样我就不会出现内存不足的情况 错误-同时,性能也很重要.您能告诉我什么是不错的选择吗?

I would like to create a text box which loads xml files and let users edit them. However, I cannot use XmlDocument to load since the files can be very large. I am looking for options to stream/load the xml document in chunks so that I do not get out of memory errors -- at the same time, performance is important too. Could you let me know what would be good options?

提前感谢您的帮助!

Smat

推荐答案

可以使用

Streaming xml can be done using XmlReader.

但是,与文本文件不同,XML文件不容易块化". -对于给定的文件偏移量,任何XML读取器都必须读取到该点为止的整个文件,以便理解XML上下文.因此,您要尝试做的事情将非常困难.

However, unlike text files, XML files are not easily "chunkable" - for a given file offset, any XML reader will have to read the entire file up to that point in order to understand the XML context. So, what you're trying to do will be rather difficult.

      -史蒂夫

       -Steve


这篇关于创建一个编辑器来编辑大型xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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