基于StAX中事件迭代器API的XML数据解析技术研究  被引量:1

Study of XML Parsing Technique Based on StAX Iterator API

在线阅读下载全文

作  者:刘雨潇[1] 冒东奎[1] 

机构地区:[1]北方民族大学计算机科学与工程学院,宁夏银川750021

出  处:《现代电子技术》2008年第10期103-105,共3页Modern Electronics Technique

摘  要:当今许多企业多数使用DOM(文档对象模型)和SAX(XML的简单API)处理XML数据。DOM的主要缺点是在XML文档被导航之前必须在内存里建立其完整的树形结构。为此,处理XML大文档需要消耗大量内存。而SAX的主要缺点在于应用程序被动地接收解析器生成的事件,因此不能通过导航随意浏览和修改XML文档的指定部分。Java EE 5新推出的StAX(Streaming API for XML,XML流式API)很好地解决了上述问题。StAX既有SAX的效率,又有DOM强大的功能。介绍StAX这种最新XML数据解析技术的开发背景,分析其解析机理和技术内涵,并在此基础之上给出一个使用基于事件迭代器的API集合解析XML文件的应用示例。实际操作表明StAX为流式处理XML提供了一个标准、双向模式的解析器接口,比StAX更简单,比DOM管理内存更有效。Nowadays, DOM and SAX are used for XML data processing in most enterprises. The main disadvantage is that an entire tree structure of a XML document must be created in the memory before it can be navigated, Consumption of a huge memory is needed for processing a big XML document, The Shortcoming of SAX is that applications passively receive the generated events by a parser, As a result, browsing and dealing with specified parts of a XML document are impossible. StAX (Streaming API for XML) introduced by Java EE 5 gives a good answer. StAX has the same efficiency as SAX,as well as the same powerful function as DOM. The development background of StAX, a latest parsing technique for XML data. is covered. The parsing mechanics and technical meaning are analyzed. On this basis, an application example for parsing XML document is given, which uses the StAX API based on the iterator. The practice proves that StAX provided a typical and dual interface for XML,it is more similiar and efficiency than SAX and DOM.

关 键 词:STAX XML XML解析 DOM 

分 类 号:TP312[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象