Favor Soup | 反胃书屋

斯是陋室,惟吾德馨。
posts - 34, comments - 18, trackbacks - 0, articles - 0
  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

XML Beginner notes (2)

Posted on 2007-04-04 16:37 D主 阅读(202) 评论(0)  编辑 收藏 引用 所属分类: XML相关

XML Schema is an XML-based alternative to DTD.
An XML schema describes the structure of an XML document.
The XML Schema language is also referred to as XML Schema Definition (XSD).


What is an XML Schema?

The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.
An XML Schema:

  • defines elements that can appear in a document
  • defines attributes that can appear in a document 
  • defines which elements are child elements 
  • defines the order of child elements
  • defines the number of child elements
  • defines whether an element is empty or can include text
  • defines data types for elements and attributes 
  • defines default and fixed values for elements and attributes

XSL

It started with XSL and ended up with XSLT, XPath, and XSL-FO.

It Started with XSL

XSL stands for EXtensible Stylesheet Language.

The World Wide Web Consortium (W3C) started to develop XSL because there was a need for an XML-based Stylesheet Language.

CSS = HTML Style Sheets

HTML uses predefined tags and the meaning of the tags are well understood.
The <table> element in HTML defines a table - and a browser knows how to display it.
Adding styles to HTML elements is simple. Telling a browser to display an element in a special font or color, is easy with CSS.


XSL = XML Style Sheets

XML does not use predefined tags (we can use any tag-names we like), and the meaning of these tags are not well understood.
The <table> element in HTML defines a table - and a browser knows how to display it.
Adding styles to HTML elements is simple. Telling a browser to display an element in a special font or color, is easy with CSS.

XSL - More Than a Style Sheet Language

XSL consists of three parts:

  • XSLT - a language for transforming XML documents
  • XPath - a language for navigating in XML documents
  • XSL-FO - a language for formatting XML documents


 

只有注册用户登录后才能发表评论。