1、1 摘 要 随着 Internet 的发展和人们对数据标准性、平台无关性的要求越来越高, XML(Extensible Markup Language)得到了广泛的应用,同时人们对于 XML 的存储方式提出 了更高的要求。 本课题意在设计一种将XML数据存入关系数据库中的方法, 并按照该方法开发一个XML 数据装入关系数据库的软件。 本文首先对 XML 的基本知识进行介绍,随后讨论用关系数据库存储 XML 数据的原因, 并对目前已经提出的一些 XML 文档在关系数据库中的存储方式进行研究讨论,在此基础上 提出一个无模式的 XML 文档对于关系数据库的存储方法。这个方法将 XML 数据分为文档、
2、 元素、属性、文本四种节点,并将这四种节点映射为数据库中四个关系表。另外将 DOM 树 中的元素节点关系映射为一个数据库关系表,这五个表是本课题中数据库设计的核心。五 个表中包含的属性信息要求方便于 DOM 接口和 SAX 接口两种方式访问。 提出存储方法后, 我们将利用这种存储方法开发一个关系数据库中 XML 数据装入系统。 文章后半部分将详细说明该软件的需求分析、设计、具体开发细节以及测试。该软件的测 试结果验证了这种存储方法能够有效的将无模式的 XML 文档存入关系数据库。 关键词:关键词:关系数据库、XML 2 Abstract With the development of Inte
3、rnet and the peoples higher and higher requirement for datas standardization and its independent of platform,XML(extensible markup language) is widely used,in the mean time the higher requirement for the storage of XML data is asked. This research group designed a method to store XML data into RDB(R
4、elational Data Base) of which the technology have been very mature and widely used.Then we developed an application that can store the XML data into RDB using this method. At first this article will introduce basical knowledge of XML,and then discuss why store XML data using RDB.After that well research and discuss the some methods for storing XML data into RDB that have been put forward.Based on them well design a storage method from non-schema XML data to RDB.We classified XML data as four