摘要
摘要
传统的数据交换系统是应用程序之间独有的,它缺乏通用性和扩展性。为了解
决这些问题,本文采用了数据交换领域中当前热门技术——可扩展标记语言
(XML)技术,提出了基于XML 技术的数据交换系统的架构。
本文通过对XML已经相关技术的介绍,使用XML作为数据交换的格式,阐述
了目前主流的两种XML数据交换模型,以及XML数据库的使用,同时简述了java
中常用几种XML解析技术。通过对XML技术的理解,简单实现了“网上书店”实例
使用XML作为数据存储工具,通过对XML文档的解析、展现等,展示XML在
internet环境中应用。本实例基于javaEE平台,使用dom4j解析XML文档,XSLT作
为XML数据转换工具,实现了“书籍”信息输入、信息展示功能。测试表明,XML
非常适合在web开发中作为数据交换格式,它良好的文档结构,优秀的可扩展性,
从一定程度上简化了数据存储逻辑;但是对于XML查询、存储等性能问题,还有
待于提高。
关键字:XML数据交换 XSLT
ABSTRACT
The traditional data exchange system is unique among applications but lacks the
versatility and scalability. To solve these problems, this article uses the current popular
t e c h n o l o g i e s - E x t e n s i b l e M a r k u p L a n g u a g e ( X M L ) t e c h n o l o g y i n t h e f i e l d o f d a t a
e x c h a n g e , p r o v i d e s t h e s t r u c t u r e o f t h e d a t a e x c h a n g e s y s t e m w h i c h b a s e s o n X M L
technology.
Based on the XML related technologies which have been introduced, with the use of
XML as the format of data exchange, we formulated the current mainstream two models
o f X M L d a t a e x c h a n g e a n d t h e u s e o f X M L d a t a b a s e , a s w e l l a s o u t l i n e d s e v e r a l
c o m monl y u s e d a n a l y t i c a l t e c h n i q u e s i n j a v a a t t h e s a m e t i m e . We m a k e t h e s i m p l e
realization of the "online bookstore" example which uses XML as a data storage tool
through the understa n d i n g o f te c h n o l o g y. With the resoluti o n o f t h e X M L document,
s h o w a n d s o o n , w e d i s p l a y t h e X M L a p p l i c a t i o n s i n t h e i n t e r n e t e n v i r o n m e n t . T h i s
e x a m p l e b a s es o n J a v a E E p l a t f o r m , u s i n g d o m 4 j fo r a n a l y zi n g X M L d o c um e n t a nd
XSLT as XML data conversion tools to achieve functions of the "book" of information
input and information display. Test showed that, XML is very suitable for use in web
development as a data interchange format, its good document structure and scalability
simplified the data storage logic to some extent; However, there is also much to do for
the XML query, storage and other performance issues.
Keywords: XML data exchange XSLT
摘要
目 录
第一章 绪论................................................................................................................................................1
1.1 XML简介..........................................................................................................................................1
1.2 XML适合的领域..............................................................................................................................2
1.3 XML作为数据交换格式的原因[1]..................................................................................................3
1.4 研究目的与意义...............................................................................................................................5
第二章 XML数据交换模型.......................................................................................................................7
2.1 XML数据交换概述..........................................................................................................................7
2.1.1
数据交换原理
............................................................................................................................7
2.1.2
数据交换存在的问题
................................................................................................................7
2.1.3 XML
与数据交换
[2]...................................................................................................................8
2.1.4 XML
数据库简述
........................................................................................................................9
2.2 XML数据交换相关技术................................................................................................................10
2.2.1 XML
与
HTML
比较
...................................................................................................................10
2.2.2 DTD
简介
[3].............................................................................................................................11
2.2.3 XML Schema
简介
[4]................................................................................................................13
2.2.4 XSLT
简介
[5]............................................................................................................................14
2.2.5 XQuery
简介
[6].........................................................................................................................15
2.2.6 JAXP
简介
.................................................................................................................................15
2.2.7 dom4j
简介
................................................................................................................................16
2.3 XML数据交换模型分析................................................................................................................16
2.3.1
数据交换系统体系结构
[7].....................................................................................................16
2.3.2
系统各模块分析
......................................................................................................................17
2.4 XML数据交换与XML数据库[8]...................................................................................................20
2.5 本章小结.........................................................................................................................................20
第三章 网上书店实例方案......................................................................................................................21
3.1 实例设计要求与原则.....................................................................................................................21
3.1.1
设计要求
..................................................................................................................................21
3.1.2
设计原则
..................................................................................................................................21
3.2 准备工作.........................................................................................................................................22
3.2.1
软件开发平台构建
..................................................................................................................22
3.2.2
软件系统功能模块需求分析
..................................................................................................22
3.2.3
数据库设计分析
......................................................................................................................23
3.3 XML数据交换模型设计................................................................................................................23
3.3.1
统一数据交换接口
..................................................................................................................23
3.3.2
架构分析
..................................................................................................................................25
3.4 本章小结.........................................................................................................................................26
第四章 网上书店实例实现......................................................................................................................27
4.1 数据库设计.....................................................................................................................................27
4.1.1
用户信息表
User......................................................................................................................27
4.1.2
书籍信息表
Book......................................................................................................................29
4.1.3
订单信息表
Orders...................................................................................................................31
4.2 XML数据处理接口设计................................................................................................................31
4.2.1
接口分析
..................................................................................................................................31
4.2.2
接口实现
..................................................................................................................................32
4.3 业务逻辑程序设计.........................................................................................................................35
4.3.1
数据库操作
..............................................................................................................................35
4.3.2
书籍信息登入操作
..................................................................................................................37
4.4 XSLT设计........................................................................................................................................39
4.4.1
书籍列表转换
..........................................................................................................................39
4.5 页面设计.........................................................................................................................................41
4.5.1
书籍列表展示页面
..................................................................................................................41
4.6 本章总结.........................................................................................................................................42
第五章 总结..............................................................................................................................................42
5.1 本文总结.........................................................................................................................................42
5.2 进一步工作.....................................................................................................................................43
致 谢..........................................................................................................................................................45
参考文献....................................................................................................................................................47