作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2008, Vol. 34 ›› Issue (4): 101-103. doi: 10.3969/j.issn.1000-3428.2008.04.035

• 软件技术与数据库 • 上一篇    下一篇

XML数据更新算法研究

鲍培明,吉根林   

  1. (南京师范大学计算机系,南京 210097)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2008-02-20 发布日期:2008-02-20

Study on Updating XML Data Algorithm

BAO Pei-ming, JI Gen-lin   

  1. (Computer Department, Nanjing Normal University, Nanjing 210097)
  • Received:1900-01-01 Revised:1900-01-01 Online:2008-02-20 Published:2008-02-20

摘要: 为了实现对XML文档的数据更新,提出一组实用算法。该算法利用简单应用编程接口扩展标记语言(SAX)解析和文件对象模型(DOM)解析,使其优势互补。应用SAX解析器将大XML文档编码成线性数据结构存储,该线性数据结构与原XML文档具有同构特性,因此,线性结构存储的数据可以无损还原为原XML文档。线性数据结构支持Xpath查询,在查询得到的局部数据上应用DOM方法进行数据更新。更新后的数据再转换为XML文档。该组算法对大XML文档的数据更新实用且有效,而且对大XML文档的其他数据处理也有一定的实用价值。

关键词: 扩展标记语言, 数据更新, SAX解析, DOM解析

Abstract: This paper proposes a set of algorithms taking advantages of SAX parser and DOM parser for large XML data update. By applying SAX parser, a large XML document is encoded into linearity data structure isomorphic with the XML document. This linearity data can be reverted to the XML document without loss. Xpath query is hold out in the linearity data structure. Use DOM parser to updata the data got from the linearity data structure by Xpath querying. This updated content is inserted into the large XML document by encoding, replacing and reverting operation. This method is practical and effective for large XML document data updating and other data processing as data query.

Key words: extensible markup language, data updating, Simple API for XML(SAX) paser, Document Object Model(DOM) paser

中图分类号: