摘要
针对目前XML文档的两种解析方法SAX和DOM各自的特点,探讨了在哪些情况下适宜将两种解析方法结合应用对文档进行解析,并给出了SAX和DOM结合应用的一般方法,最后对单纯采用DOM和两种方法结合解析XML文档的性能进行了比较。实验结果表明,将SAX和DOM结合使用,在解析大XML文档时,可以极大地提高解析程序的性能。
According the characteristics of two methods of parsing XML documents-SAX and DOM, this paper discusses when we should use two methods together to parse documents. Then we provide common procedure of using SAX and DOM together. At last, by parsing different size of XML documents, this paper compare the performance of DOM with SAX and DOM used together. The test results indicate that when parsing large XML document, using SAX and DOM together can improve the performance of parsing program greatly.
出处
《微型电脑应用》
2011年第12期42-44,70-71,共5页
Microcomputer Applications