XML related technologies n n XML DTD Schema

  • Slides: 90
Download presentation

XML related technologies n n XML, DTD, Schema, XSLT, DOM, PDOM, SAX, XPATH, XQuery….

XML related technologies n n XML, DTD, Schema, XSLT, DOM, PDOM, SAX, XPATH, XQuery…. . Web Service, RDF, WSDL, SOAP, Semantic Web, Grid, Ontology…. . XML Message, EAI… CML, Math. ML, Voice. ML, SVG, SMIL, Dr. ML, eb. XML…

We’ll cover … XML XSLT DTD Xlink Schema XPointer Namespace XInclude DOM SOAP SAX

We’ll cover … XML XSLT DTD Xlink Schema XPointer Namespace XInclude DOM SOAP SAX Biztalk XPath XML & encryption, signature, security XQuery XML & Databases CSS XML & DOTNET XSL XML & JAVA

标记语言发展简史 n 专用数据格式: Proprietary Data Format (与生成厂 商、平台密切相关) n Standard Generalized Markup Language (SGML)

标记语言发展简史 n 专用数据格式: Proprietary Data Format (与生成厂 商、平台密切相关) n Standard Generalized Markup Language (SGML) n Hypertext Markup Language (HTML) n Dynamic Hypertext Markup Language (DHTML) n e. Xtensible Hypertext Markup Language (XHTML) n e. Xtensible Markup Language (XML)

一个 XML 示例文档 <? xml version="1. 0" encoding="UTF-8"? > <book year="1994"> <title>TCP/IP Illustrated</title> <author>

一个 XML 示例文档 <? xml version="1. 0" encoding="UTF-8"? > <book year="1994"> <title>TCP/IP Illustrated</title> <author> <last>Stevens</last> <first>W. </first> </author> <publisher>Addison-Wesley</publisher> <price> 65. 95</price> </book> n book. xml n 浏览器中的显示 n XMLSPY 中的显示、及 XMLSPY 中其他 XML 文档

XML 的定义 n XML 是一种标记语言,用于表示包含结构信 息的数据。 XML is about moving all forms of data

XML 的定义 n XML 是一种标记语言,用于表示包含结构信 息的数据。 XML is about moving all forms of data and its meaning from many types of source to any kind of destination. n

XML 的十个设计目标 (1) 1. XML shall be straightforwardly usable over the Internet. 2. XML

XML 的十个设计目标 (1) 1. XML shall be straightforwardly usable over the Internet. 2. XML shall support a wide variety of applications. 3. XML shall be compatible with SGML. 4. It shall be easy to write programs that process XML documents. 5. The number of optional features in XML is to be kept to the absolute minimum, ideally zero. Tim Bray(one of the three editors of the XML specification)

XML 的十个设计目标 (2) 6. XML documents reasonably clear. should be human-legible and 7. The

XML 的十个设计目标 (2) 6. XML documents reasonably clear. should be human-legible and 7. The XML design should be prepared quickly. 8. The design of XML shall be formal and concise. 9. XML documents shall be easy to create. 10. Terseness in XML markup is of minimal importance. Tim Bray(one of the three editors of the XML specification)

XML 编程接口 n n n Core SAX, DOM(W 3 C Standard model) Microsoft XML

XML 编程接口 n n n Core SAX, DOM(W 3 C Standard model) Microsoft XML Parser (MSXML) Java : q q q JDOM (Java DOM) JAXP (Java API for XML) Tr. AX (Transformation API for XML) JAXB (Java Architecture for XML Binding ) XML 4 J (XML for Java) ……

<? xml version="1. 0" standalone="yes"? > <!DOCTYPE book [ <!ENTITY % html. 4. entities

<? xml version="1. 0" standalone="yes"? > <!DOCTYPE book [ <!ENTITY % html. 4. entities SYSTEM "1. ent"> %html. 4. entities; ]> <book> <title>  Data on the Web  </title> </book>

有关元素命名的示例 n n 下列 XML 标记名称都是正确的: <example-one>、<_example 2>、<Example. Three> 下列 XML 标记名称都是错误的: <bad*charater>、<illegal space>、<12

有关元素命名的示例 n n 下列 XML 标记名称都是正确的: <example-one>、<_example 2>、<Example. Three> 下列 XML 标记名称都是错误的: <bad*charater>、<illegal space>、<12 number-start>

XML 的命名空间使用 n 任何命名空间只能够在其作用域内进行使用, 在同一个命名空间里,所有的元素名和属性名 都必须唯一。 <? xml version="1. 0" encoding="UTF-8"? > <ns: company

XML 的命名空间使用 n 任何命名空间只能够在其作用域内进行使用, 在同一个命名空间里,所有的元素名和属性名 都必须唯一。 <? xml version="1. 0" encoding="UTF-8"? > <ns: company xmlns: ns="http: //www. myns. com"> <ns: company-info> <ns: name>Software. BG</ns: name> <ns: fdate>2007 -03 -17</ns: fdate> <ns 1: division xmlns: ns 1="http: //www. myns. com/division"> <ns 1: name>Development</ns 1: name> <ns 1: employees>100</ns 1: employees> </ns 1: division> </ns: company-info> </ns: company>

缺省命名空间 n XML Namespace 1. 0 规范中提供了一种缺省 命名空间的机制,以简化命名空间的使用。 <? xml version="1. 0" encoding="UTF-8"? >

缺省命名空间 n XML Namespace 1. 0 规范中提供了一种缺省 命名空间的机制,以简化命名空间的使用。 <? xml version="1. 0" encoding="UTF-8"? > <company xmlns="http: //www. myns. com"> <company-info> <name>Software. BG</name> <fdate>2007 -03 -17</fdate> <ns 1: division xmlns: ns 1="http: //www. myns. com/division"> <ns 1: name>Development</ns 1: name> <ns 1: employees>100</ns 1: employees> </ns 1: division> </company-info> 进一步修改! </company>

UTF-16与增补字符 n n n Unicode 编码 0 x 10000 -0 x 10 FFFF 第

UTF-16与增补字符 n n n Unicode 编码 0 x 10000 -0 x 10 FFFF 第 一 个 WORD的 高 6位 是 110110, 第 二 个 WORD的高 6位是 110111 第 一 个 WORD的 取 值 范 围 ( 二 进 制 ) 是 11011000 0000到 11011011 1111, 即 0 x. D 800 -0 x. DBFF。第二个WORD的取值范 围 ( 二 进 制 ) 是 11011100 0000到 11011111,即 0 x. DC 00 -0 x. DFFF。

Java中的字符、字符串数据(2) n char. At(n)将返回第n个char中的内容 char first = greeting. char. At(0); //first is ‘H’ char

Java中的字符、字符串数据(2) n char. At(n)将返回第n个char中的内容 char first = greeting. char. At(0); //first is ‘H’ char last = greeting. char. At(4); //last is ‘o’ n 要想得到第i个代码点,应该使用 int index = greeting. offset. By. Code. Points(0, i); int cp = greeting. code. Point. At(index); n char ch = sentence. char. At(1);

Base 64 编码表

Base 64 编码表