XML DTD 理論 (1) XML 論 數
(Markup) 念 SGML XML XML XML 2003 All Rights Reserved 2
SGML Standard Generalized Markup Language ( ) XML Extensible Markup Language HTML HyperText Markup Language 2003 All Rights Reserved 3
(Markup) 念 類 (Procedural Markup) : 行 例 Microsoft Word PDF (Descriptive Markup) : 行 例 SGML XML 2003 All Rights Reserved 4
(Procedural Markup) 行 見 (What You See Is What You Get) 便 ex. binary code) 2003 All Rights Reserved 5
(Descriptive Markup) 行 (stylesheet) ASCII code 利 量 利 2003 All Rights Reserved 6
2003 All Rights Reserved 7
不 利 更 易 2003 All Rights Reserved 8
XML HTML 了 Web XML 都 SGML structured information SGML HTML 不 XML SGML HTML 2003 All Rights Reserved 9
HTML HTML 來 HTML 不 行 HTML 精 料 HTML 不 HTML Extension 不 2003 All Rights Reserved 10
SGML (Standard Generalized Markup Language) 1986 年 ISO ISO 8879 了 來 不 metalanguage 行 來 2003 All Rights Reserved 11
SGML (flexibility) : (non-proprietary) 立 (platform-independence) 立 (system-independence) : 利 利 (re-usability) 2003 All Rights Reserved 12
SGML SGML SGML SGML 不易 Web 2003 All Rights Reserved 13
XML Extensible Markup Language) W3C 1996 年 SGML 來 (meta-language) 1998/2 XML1.0 Recommendation 了 Sun Microsystesms, Microsoft, Netscape, Adobe, ArborText,... 2003 All Rights Reserved 14
XML XML Internet XML SGML 理 XML 易 XML 量 零 省略 XML 來說 不.. 2003 All Rights Reserved 15
XML 例 XML <customer-details id="acpharm39156"> <name>acme Pharmaceuticals Co.</name> <address country="us"> <street>7301 Smokey Boulevard</street> <city>smallville</city> <state>indiana</state> <postal>94571</postal> </address> </customer-details> 2003 All Rights Reserved 16
SGML HTML XML SGML(1986) HTML SGML (1996, HTML 3.2) XML SGML (1998, XML 1.0) XML HTML XML SGML HTML 2003 All Rights Reserved 17
W3C 料 2003 All Rights Reserved 18
XML SGML 都 Meta-Language 不 都 (extensibility) (structure) (validation) DTD 來 都 來 都 利 讀 2003 All Rights Reserved 19
XML SGML 異 SGML DTD XML DTD 不 SGML (Inclusion) (Exclusion) 兩 來 (content model) 例 理 (Exceptions) XML 不 例 理 XML 不 AND(&) SDATA internal entities 2003 All Rights Reserved 20
XML HTML (extensibility) (structure) (validation) HTML XML 行 便 行 tags 更 料 attribute 不 料 (schema) 來 HTML (DTD) 行 行 2003 All Rights Reserved 21
XML Well-formed XML 參 DTD Valid XML 參 DTD XML 都 Well-formed XML 2003 All Rights Reserved 22
Well-formed XML 不 省略 ( <p>..</p>) 狀 (nest) ( <B><I>bold and italic</b>italic</i> 不 ) XML ( <img src= /> ) ( <font size= 2 > ) 2003 All Rights Reserved 23
Well-Formed XML 1 : XML 2 : 3 : XML 4 : (parsing) XML 2003 All Rights Reserved 24
1: XML <?xml version= 1.0?> <?xml version= 1.0 encoding= UTF-8?> <?xml version= 1.0 encoding= big5?> 2003 All Rights Reserved 25
2: <?xml version= 1.0 encoding= big5?> <record-list> </record-list> 2003 All Rights Reserved 26
3: XML <?xml version="1.0" encoding="big5"?> <record-list>. <record> <seq>1</seq> <title>xml RDF </title> <creator> 梁 </creator> <journal> </journal> <vol>220</vol> <date>90.07</date>.. <url>http://www2.read.com.tw/..</url>.. </record>.. </record-list> 2003 All Rights Reserved 27
Well-formed XML Microsoft Internet Explorer 6.0 2003 All Rights Reserved 28
XML Microsoft Internet Explorer 6.0 2003 All Rights Reserved 29
XML (Style Sheet) XSL (Extensible Stylesheet Language) W3C Recommendation, 2001/10/15 CSS (Cascading Style Sheet) W3C Recommendation 2003 All Rights Reserved 30
CSS(Cascading Style Sheet) XSL W3C 流 2003 All Rights Reserved 31
CSS XML CSS <?xml version= 1.0 standalone= no?> <?xml-stylesheet href= *.css type= text/css?> 不 = + 不 2003 All Rights Reserved 32
CSS 度 度 離 2003 All Rights Reserved 33
XSL XSL well-formed XML XSL 數 CSS XSL 兩 XML XSLT(XSL Transformations) 1.0 W3C Recommendation ; 1999/11/16 令 (formatting object) XML XSL 1.0 W3C Recommendation; 2001/10/15 2003 All Rights Reserved 34
XSL CSS XSL CSS HTML? no yes XML? yes yes 不? yes no? XML CSS 2003 All Rights Reserved 35
XSLT XML XML 來 不 Metadata XML HTML (XHTML) HTML well-formed XSL XSL 2003 All Rights Reserved 36
XSLT 路 Server Real-time Server Load Batch Server Load Client Browser XSLT 不!? http request browser type Server Client 2003 All Rights Reserved 37
XSL 理 理 讀 XML 狀 (source tree) 狀 (result tree) 2003 All Rights Reserved 38
XSL XML XSL <?xml version= 1.0 standalone= no?> <?xml-stylesheet href= *.xsl type= text/xsl?> 不 不 2003 All Rights Reserved 39
XSL 料 2003 All Rights Reserved 40
XSL xsl:stylesheet xsl:template match xsl:value-of select xsl:for-each select xsl:apply-templates 2003 All Rights Reserved 41
料 XSL xsl:comment xsl:copy xsl:attribute xsl:element 2003 All Rights Reserved 42
XSL xsl:if xsl:choose xsl:when xsl:otherwise 2003 All Rights Reserved 43
連 XSL XML <?xml version="1.0" encoding="big5"?> <?xml-stylesheet href="ncl_journal_search_2.xsl" type="text/xsl"?> <record-list>. <record> <seq>1</seq> <title>xml RDF </title> <creator> 梁 </creator> <journal> </journal>.. </record>.. </record-list> 2003 All Rights Reserved 44
XSL XML Microsoft Internet Explorer 6.0 2003 All Rights Reserved 45
XML XML 1.0 : W3C Recommendation 10-Feb-1998 Namespaces in XML: W3C Recommendation 14-Jan-1999 XSLT : W3C Recommendation 16-Nov-1999 XML Schema : W3C Recommendation 2-May-2001 XHTML 1.1 : W3C Recommendation 31-May-2001 XLink : W3C Recommendation 27-June-2001 XSL : W3C Recommendation 15-Oct-2001 2003 All Rights Reserved 46
XHTML HTML 不 (1/6) well-formed Example: CORRECT: nested elements <p>here is an emphasized <em>paragraph</em>.</p> INCORRECT: overlapping elements <p>here is an emphasized <em>paragraph.</p></em> 2003 All Rights Reserved 47
XHTML HTML 不 (2/6) Example: CORRECT: <li>. INCORRECT: <LI>. 2003 All Rights Reserved 48
XHTML HTML 不 (3/6) 了 都 Example: CORRECT: terminated elements <p>here is a paragraph.</p> <p>here is another paragraph.</p> INCORRECT: unterminated elements <p>here is a paragraph. <p>here is another paragraph. 2003 All Rights Reserved 49
XHTML HTML 不 (4/6) 都 Example: CORRECT: quoted attribute values <table rows="3"> INCORRECT: unquoted attribute values <table rows=3> 2003 All Rights Reserved 50
XHTML HTML 不 (5/6) 不 Example: CORRECT: unminimized attributes <dl compact="compact"> INCORRECT: minimized attributes <dl compact> 2003 All Rights Reserved 51
XHTML HTML 不 (6/6) Example: CORRECT: terminated empty tags <br/><hr/> INCORRECT: unterminated empty tags <br><hr> 2003 All Rights Reserved 52
XML 料 Client 理 濾 利 2003 All Rights Reserved 53
XML 例 浪 館 2003 All Rights Reserved 54
XML 例 浪 館 2003 All Rights Reserved 55
浪 (2) (3) XML (1) (4) XML HTML Client (5) metadata 更 User 2003 All Rights Reserved 56
Questions? 來 joe@airiti.com 2003 All Rights Reserved 57