码家

Web Platform, Cloud and Mobile Application Development

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Unit 5

XML用来干什么的?

Well-formed XML Documents

XML  Technology

  1. Content : XML Doc
  2. Structure : XSD (XML Schema Definition)(.xsd)
  3. Presentation : XSL (XML Style sheet Language)

Valid XML Documents

  1. 只有在Schema的基础上才谈得上valid
  2. 遵守了Schema的称为是valid 的

Parsers

  1. DOM Parser(Document Object Model)

XML文件放入memory(Entire File needs to be in memory)

形成层次的树结构(tree based)

对较大的xml文件不适用

很容易实现

。。。。。。

  1. SAX Parser(Simple API for XML)

基于事件的(event based)

从顶至下执行(像流一样的处理xml信息)

适用于大型xml文件

Processing 比DOM快

不创建内部文件(Entire File needs to be in memory)

。。。。。。

  1. MSXML Parser

HTML  VS  XML

Applications of XML

Unit 6  XML Schema

Introduction to XML Schema

  1. XML schema describes the structures of an xml document
  2. Support data types
  3. Support namespace

Element  type

  1. Simple Type Element

No  child elements

No  attributes

Contains  only text

Can contain sting,numbers,datas

  1. Complex Type Element

With other elements,attributes,mixed content

Element with or without attributes

Data types

  1. Built-in Simple Types
  2. Primitives data type
  3. Derived data types
  4. Atomic data types
  5. List data types
  6. Union data types

Occurrence of Elements

  1. minOccurs
  2. maxOccurs
  3. default value is 1
  4. min不能为无限的
  5. +,?,*

Namespace:

  1. 解决元素同名纷争
  2. 统一资源标示符
  3. xmlns关键字
  4. xmlns:prefix=“URI”
posted on 2011-05-16 17:10  海山  阅读(164)  评论(0)    收藏  举报