Some simple facts about XML (二)
2009-10-02 18:29
489 查看
下面的内容主要来自:
Practical XML Schema (A Java programmers guide to XML Schema and Namespaces)
http://www.javaworld.com/javaworld/jw-08-2005/jw-0808-xml.html?page=1#resources
DTD & Schema
有两种方式定义XML的结构:Document Type Definition (DTD) 和 Schema。
DTD
- DTDs were inherited from XML's origins as SGML (Standard Generalized Markup Language) and, as such, are limited in their expressiveness.
- DTDs are for expressing a text document's structure, so all entities are assumed to be text.
- DTDs enforce a strict ordering of elements; schemas have a more flexible range of options (elements can be optional as a group, in any order, in strict sequence, etc.)
- DTDs have their own syntax
XML Schema
- The XML Schema language more closely resembles the way a database describes data。
- Schemas provide the ability to define an element's type (string, integer, etc.) and much finer constraints (a positive integer, a string starting with an uppercase letter, etc.)
- schemas are written in XML
XML 1.0 或 1.1
XML exists in two versions: 1.0 defined in 1998 and 1.1 defined in 2004. XML 1.1 adds very little to 1.0: support for defining elements and attributes in languages such as Mongolian or Burmese, support for IBM mainframe end-of-line characters, and almost nothing else. For the vast majority of applications, these changes are not needed. Plus, a document declared as XML 1.1 will be rejected by a 1.0 parser. So stick with 1.0.
Well-formed and valid XML
well-formed就是文法正确,valid就是xml还要符合对应的DTD或Schema的定义(如果有的话)
Practical XML Schema (A Java programmers guide to XML Schema and Namespaces)
http://www.javaworld.com/javaworld/jw-08-2005/jw-0808-xml.html?page=1#resources
DTD & Schema
有两种方式定义XML的结构:Document Type Definition (DTD) 和 Schema。
DTD
- DTDs were inherited from XML's origins as SGML (Standard Generalized Markup Language) and, as such, are limited in their expressiveness.
- DTDs are for expressing a text document's structure, so all entities are assumed to be text.
- DTDs enforce a strict ordering of elements; schemas have a more flexible range of options (elements can be optional as a group, in any order, in strict sequence, etc.)
- DTDs have their own syntax
XML Schema
- The XML Schema language more closely resembles the way a database describes data。
- Schemas provide the ability to define an element's type (string, integer, etc.) and much finer constraints (a positive integer, a string starting with an uppercase letter, etc.)
- schemas are written in XML
XML 1.0 或 1.1
XML exists in two versions: 1.0 defined in 1998 and 1.1 defined in 2004. XML 1.1 adds very little to 1.0: support for defining elements and attributes in languages such as Mongolian or Burmese, support for IBM mainframe end-of-line characters, and almost nothing else. For the vast majority of applications, these changes are not needed. Plus, a document declared as XML 1.1 will be rejected by a 1.0 parser. So stick with 1.0.
Well-formed and valid XML
well-formed就是文法正确,valid就是xml还要符合对应的DTD或Schema的定义(如果有的话)
相关文章推荐
- some simple facts about XML (三)
- Some simple facts about XML (一)
- Some interesting facts about static member functions in C++
- Some interesting facts about static member functions in C++
- android graphic(18)—How about some Android graphics true facts?
- 转:Some interesting facts about SharePoint 2007 Search
- Some facts about topological sort
- How about some Android graphics true facts
- Some interesting facts about static member functions in C++
- Some points about postback and multi-language drop down list
- some tips about shell variables
- Some useful information about Active Directory help tool
- some thinking about management
- 【转载】 Some tutorials about CGAL
- Just a simple case about the oracle 11gR1 dataguard configuration
- Note-1:simple bakefile xml
- some ideAs About steAlth for rootkit
- some articles about linear-Z buffer and W-buffer
- simple build.xml
- Some really good discussions about material/shader system on gamedev.net