The XML Standard.ppt
《The XML Standard.ppt》由会员分享,可在线阅读,更多相关《The XML Standard.ppt(86页珍藏版)》请在麦多课文档分享上搜索。
1、The XML Standard,Overview of our XML Standards,Motivation: HTML vs XML XML 101: syntax, elements, attributes, DTDs, XML 201: XML Schema, Namespaces XSLT: Transforming and Rendering XML XQuery: Search, Transform & Integrate,So what is XML (all about)?,Executive Summary: XML = HTML idiosyncrasies (sim
2、plified syntax) + user-definable (“semantic“) tags Separation of data and its presentation= simple, very flexible data exchange format:semistructured data model = new applications: Information exchange (B2B), sharing (diglib), integration (“mediation“), archival, . Web site mangement (XML+XSL styles
3、heets), .,Whats Wrong with HTML?,Y.Papakonstantinou, S. Abiteboul, H. Garcia-Molina. “ObjectFusion in Mediator Systems“. In VLDB 96. ,Y. Papakonstantinou, S. Abiteboul, H. Garcia-Molina. “Object Fusion in Mediator Systems”. In VLDB 96.,HTML confuses presentation with content,.Whats Wrong with HTML.,
4、Y.Papakonstantinou, S. Abiteboul, H. Garcia-Molina. “ObjectFusion in Mediator Systems“. In VLDB 96. ,No Explicit Structure,Semantics, or Object-Orientation,Author,Conference,Title,. And Some Repercussions,Lack of schema/semantics when querying the Web (HTML): “find documents (books, papers, .) where
5、 author = Michael Jackson“ (. and learn how software engineering meets the moon walker .) “create a list of M. Jacksons books and (if available) their prices“= HTML is inappropriate for data exchange automation of information management (retrieval, manipulation, integration),XML is Based on Markup,Y
6、.PapakonstantinouS. AbiteboulH. Garcia-MolinaObject Fusion in Mediator Systems VLDB 96,Markup indicates structure and semantics,Decoupled from presentation,Elements and their Content,element,element name,Character content,Element Content,Empty Element,Y.PapakonstantinouS. AbiteboulH. Garcia-MolinaOb
7、ject Fusion in Mediator Systems VLDB 96,Element Attributes,Y.PapakonstantinouS. AbiteboulH. Garcia-MolinaObject Fusion in Mediator Systems VLDB 96,Attribute name,Attribute Value,XML = Labeled Ordered Trees,YannisSerge.Object Fusion., semistructured data labeled trees/graphs,can also representrelatio
8、nal and object-oriented data,id,23,How do I share structure and metadata/semanticswith my community?,In Search of the Lost Structure & Semantics,How to make all this automatable?,How do I learn and usethe element structure of a document?,Adding Structure and Semantics,XML Document Type Definitions (
9、DTDs): define the structure of “allowed“ documents (i.e., valid wrt. a DTD) database schema = improve query formulation, execution, . XML Schema defines structure and data types XML Namespaces identify your vocabulary Resource Description Framework (RDF) simple metadata model,XML DTDs as Extended CF
10、Gs,lhs = element (name) rhs = regular expression over elements + strings (PCDATA),XML DTD,Grammar,Document Type Definitions (DTDs),Define and Constrain Element Names & Structure,Element Type Declaration,Attribute List Declaration,Element Declarations,Character content,Authors followed by optional fu
11、llpaper, followed by title, followed by booktitle,Sequence of 1 or more author,Sequence of 0 or more paper,Element Content Declarations,Attributes,Y.PapakonstantinouObject Fusion in Mediator Systems,Object Identity Attribute,CDATA (character data), Yannis info ,IDREF intradocument reference,Referenc
12、e to external ENTITY,Attribute Types,More on Attribute Declarations,Attributes may be REQUIRED IMPLIED (optional) can have default values default value may be FIXED,Uses of XML Entities,Physical partition size, reuse, “modularity“, (both XML docs & DTDs) Non-XML data unparsed entities binary data No
13、n-standard characters character entities Shorthand for phrases & markup,Types of Entities,Internal (to a doc) vs. External ( use URI) General (in XML doc) vs. Parameter (in DTD) Parsed (XML) vs. Unparsed (non-XML),Internal Text Entities,We all use the .,Internal Text Entity Declaration,Entity Refere
14、nce,We all use the World Wide Web.,Logically equivalent to actually appearing,Unparsed (& “Binary“) Entities,. and unparsed entity,Element with ENTITY attribute,Declare attribute type to be entity,NOTATION declaration (helper app),Declare external.,From Docs to Data: XML Schema,XML DTDs (part of the
15、 XML spec.) flexible, semistructured data model (nesting, ANY, ?, *, |, .) but document-oriented (SGML heritage) XML Schema (W3C working draft) schema definition language in XML data-oriented: data types extends capabilities of DTD,Sample Data for Introduction to XML Schema, Being a Dog Is a Full-Ti
16、me JobCharles M. SchulzSnoopyPeppermint Patty1950-10-04extroverted beagle Peppermint Patty1966-08-22bold, brash and tomboyish,The Simple “Russian Doll” Approach to XML Schema,Optional Namespace Definition,Sequence Compositor,Simple Type Content for title and author,Complex Type Content for book,Char
17、acter may appear any number of times,Basic Type of XML Schema,The Catalog Approach to XML Schema: Stand-Alone Declarations & References,Simple Type Elements,Attributes,Complex Type Element character,Reference,Catalog Approach Contd,Named Types,Write stand-alone named complex type or simple type decl
18、arations Primitive form of inheritance (called derivation) allows Restriction Extension,nameType derived from xsd:string by having the xsd:maxLength facet restrict string to a Maximum of to 32 characters,nameType used in the declaration of characterType,Groups: Named containers of sets of Elements o
19、r Attributes,Compositors: Sequence, Choice, All,So far we have seen sequences,The group nameTypes consists of one of the element “name” the sequence containing firstName,middlename, lastName,Compositors (contd),The characterType consists of name, a list of friend-of, since, and qualification particl
20、es in no particular order. (Compare with the sequence compositor.),Derivation of Simple Types: Unions and Lists,So far we have seen restrictions and facets,The simple type isbnType will be either a 10-digit string (notice the pattern) the token “TBD“ or the token “NA“,Constraints: Uniqueness, ,By in
21、serting xsd:unique in the book element declaration we enforce that the character names in each book are unique,Namespaces,Including Unknown Elements,Presenting XML: XSLT,Why Stylesheets? separation of content (XML) from presentation (XSL) Why not just CSS for XML? XSL is far more powerful: selecting
22、 elements transforming the XML tree content based display (result may depend on data),XSLT Overview,XSLT stylesheets are denoted in XML syntax XSL components: 1. a language for transforming XML documents (XSLT: integral part of the XSL specification) 2. an XML formatting vocabulary (Formatting Objec
23、ts: 90% of the formatting properties inherited from CSS),XSLT Processing Model,XSLT Processing Model,XSL stylesheet: collection of template rules template rule: (pattern template) main steps: match pattern against source tree instantiate template (replace current node “.” by the template in the resu
24、lt tree) select further nodes for processing control can be program-driven (“pull“: .) data/event-driven (“push“: .),Template Rule: Example,(i) match pattern: process elements (ii) instantiate template: replace each a product with two HTML tables (iii) select the grandchildren (“sales/domestic”, “sa
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- THEXMLSTANDARDPPT
