摘要
StAX是JCP提出的一种新的XML解析方式,它提供给用户更多的解析控制权。本文给出了用于XML语法分析的下推自动机模型的设计以及StAX解析器OnceStAXParser的实现。OnceStAXParser在经过了严格的XML兼容性测试和StAXAPI兼容性测试之后,还从多个方面进行了性能优化,包括自动机实现优化、有计划的预分配和延迟处理策略以及适度封装策略等。性能测试数据表明,OnceStAXParser的吞吐量比SunSJSXP平均高5%,比BEAStAXRI平均高38%。
StAX is presented by JCP JSR-173 specification which supports XML pull parsing and gives more parsing control to users. This paper describes the design of pushdown automaton model for XML syntax analysis and illustrates the implementation of StAX parser OnceStAXParser. After passing the rigorous XML conformance tests and StAX API conformance tests,OnceStAXParser is optimized from many aspects such as the implementation of pushdown automaton,arranged pre-allocation and lazy processing,appropriate encapsulation strategy, etc. The performance test results from XML Test suite show that the throughput of OnceStAXParser is 5% more than that of SJSXP on the average,and is 38% more than that of BEA StAX RI on the average.
出处
《计算机科学》
CSCD
北大核心
2006年第6期128-131,273,共5页
Computer Science
基金
国家973项目(编号2002CB312005)
国家863项目(编号2001AA113010)的资助。