More XML namespaces, DTDs CS 431 – February 16, 2005 Carl Lagoze – Cornell University.

Slides:



Advertisements
Similar presentations
XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
Advertisements

1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
History Leading to XHTML
XML Document Type Definitions ( DTD ). 1.Introduction to DTD An XML document may have an optional DTD, which defines the document’s grammar. Since the.
1 XML DTD & XML Schema Monica Farrow G30
XML Study-Session: Part II Validating XML Documents.
An Introduction to XML Schema CSCI 7818 by Ming Rutar.
CSE 636 Data Integration XML Schema. 2 XML Schemas W3C Recommendation: Generalizes DTDs Uses XML syntax Two documents: structure.
XML Schemas Lecture 10, 07/10/02. Acknowledgements A great portion of this presentation has been borrowed from Roger Costello’s excellent presentation.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
Document Content Description for XML, Version 1.0 By Tim Bray, Charles Frankston and Ashok Malhotra EECS 684 Presentation by Calvin Ang.
Sunday, June 28, 2015 Abdelali ZAHI : FALL 2003 : XML Schemas XML Schemas Presented By : Abdelali ZAHI Instructor : Dr H.Haddouti.
XML Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
Unit 4 – XML Schema XML - Level I Basic.
Introduction to XML This material is based heavily on the tutorial by the same name at
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Introduction to XML: Part I By Sandeep Jangity CS 157B, Section 2 Dr. Lee.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Document Type Definition.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
IS432 Semi-Structured Data Lecture 3: XSchema Dr. Gamal Al-Shorbagy.
Chapter 4: Document Type Definitions. Chapter 4 Objectives Learn to create DTDs Validate an XML document against a DTD Use DTDs to create XML documents.
1 XML Schemas. 2 Useful Links Schema tutorial links:
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
Introduction to XML. What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.
Cornell CS 502 More XML XHTML, namespaces, DTDs CS 502 – Carl Lagoze – Cornell University.
XML - Why: The HTML-Dilemma HTML, SGML, XML - How: Syntax, Concept, Language Elements Basics Well-formed XML-Documents (without DTD) Valid XML-Documents.
TEXT ENCODING INITIATIVE (TEI) Inf 384C Block II, Module C.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
FIGIS’ML Hands-on training - © FAO/FIGIS An introduction to XML Objectives : –what is XML? –XML and HTML –XML documents structure well-formedness.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Of 33 lecture 3: xml and xml schema. of 33 XML, RDF, RDF Schema overview XML – simple introduction and XML Schema RDF – basics, language RDF Schema –
New Perspectives on XML, 2nd Edition
An OO schema language for XML SOX W3C Note 30 July 1999.
More XML namespaces, DTDs CS 431 – Carl Lagoze – Cornell University.
An Introduction to XML Sandeep Bhattaram
CSE3201 Information Retrieval Systems DTD Document Type Definition.
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
XML 2nd EDITION Tutorial 4 Working With Schemas. XP Schemas A schema is an XML document that defines the content and structure of one or more XML documents.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
Management of XML and Semistructured Data Lecture 10: Schemas Monday, April 30, 2001.
Processing of structured documents Spring 2003, Part 3 Helena Ahonen-Myka.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
XML Validation II Schemas Robin Burke ECT 360. Outline Namespaces Documents  Data types XML Schemas Elements Attributes Derived data types RELAX NG.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Primer on XML Schema CSE 544 April, XML Schemas Generalizes DTDs Uses XML syntax Two parts: structure and datatypes Very complex –criticized –alternative.
When we create.rtf document apart from saving the actual info the tool saves additional info like start of a paragraph, bold, size of the font.. Etc. This.
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name value pair;
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 14 This presentation © 2004, MacAvon Media Productions XML.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
CITA 330 Section 2 DTD. Defining XML Dialects “Well-formedness” is the minimal requirement for an XML document; all XML parsers can check it Any useful.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML QUESTIONS AND ANSWERS
Namespace Review 21-Nov-18.
Namespace Review 29-Dec-18.
More XML XML schema, XPATH, XSLT
Namespace Review 14-Oct-19.
New Perspectives on XML
Presentation transcript:

More XML namespaces, DTDs CS 431 – February 16, 2005 Carl Lagoze – Cornell University

Namespaces How the web does work –Individually created documents linked by ambiguous references How the web should work –Global database of knowledge Key to doing that is to permit distributed knowledge creation and lazy integration Problems –Vocabulary collisions –Joins Namespaces –Build on URI notion –Make it possible to uniquely qualify intra-document name collisions

My home page My hobby My books Kevin Davies Cracking the Genome 20.00

My home page My hobby My books Kevin Davies Cracking the Genome 20.00

My home page My hobby My books Kevin Davies Cracking the Genome 20.00

boxhtml bo:Book bo:title bo:author bo:price bo:ISBN xhtml:html xhtml:head xhtml:body xhtml:p xhtml:title vocabulary bo vocabulary xhtml XML – namespaces But who guarantees uniqueness of prefixes?

XML – namespaces Give prefixes only local relevance in an instance document Associate local prefix with global namespace name  a unique name for a namespace  uniqueness is guaranteed by using a URI (preferably URN ) in domain of the party creating the namespace  doesn’t have any meaning, i.e. doesn’t have to resolve into anything An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names.

<xhtml:html xmlns:xhtml=“ xmlns:bo=“ My home page My hobby My books Kevin Davies ………………

<html xmlns=“ xmlns:bo=“ My home page My hobby My books Kevin Davies ………………

<html xmlns=“ My home page My hobby My books Kevin Davies ………………

<html xmlns=“ My home page My hobby My books Kevin Davies ………………

What do namespace URI’s point to? There are lots of opinions on this subject! The “abstraction” camp –A namespace URI is the id for a concept –It shouldn’t resolve to anything –Example – my SSN #, it doesn’t point to Carl Lagoze but to the concept of Carl Lagoze with different facets can be (ab)used in numerous concepts The “orthodox” camp –It should resolve to a schema (xml schema) The “liberal” camp –It should resolve to many things –RDDL ( ) Moral: Interoperability is hard once you move beyond the basics

From well-formedness to validity Goal of standards is interoperability –Allow different communities to share data –Requires meta-level understanding Levels of interoperability –Base-level syntax: xml well-formedness –Vocabulary: tree structure, DTD conformance –Towards Semantics: xml schema, rdf schema, etc.

DTD – Document Type Definition Artifact of XML’s roots in SGML Defines validity XML document Useful for interoperability among document instances Can be internal: – or external: – Must follow XML declaration before any elements

Constructing a DTD: Entities Using entities for simple abbreviations –Entity creation in DTD Carl Lagoze "> –Entity use in XML document &me; Using entities for inter-DTD modularity –Entity creation in DTD

Constructing a DTD: Entities Entities within Entities Leads to an instance such as: La Peste: Camus, © 1947 Éditions Gallimard

Constructing a DTD - Elements Declaration of element Types –EMPTY – no children, only attributes –ELEMENT – only children, no text –MIXED – children and text (PCDATA) –ANY –Content Model

Constructing a DTD - Attributes Attributes are a way of associating properties or refinements with elements Syntax – Standard attribute types –CDATA character data –ID unique identifier in XML document –(en1|en2|..) enumerated list Default values –value the default value –#REQUIRED attribute must be included with element –#IMPLIED attributed does not have to be included

birthday=“ ”>Kevin Davies Cracking the Genome $20.00 <!ATTLIST author birthday CDATA #IMPLIED sex (male|female) #IMPLIED>

XML – XML schema Problems with XML DTD’s: DTD’s are not extensible: Can import declarations from other DTD’s (external entity). Can not inherit or refine those declarations. A document must be valid according to 1 DTD: prevents building on elements from different DTDs Limited support of namespaces

Poor data typing: DTDs are mainly about “text”. No provision for numeric data types, dates, times, strings conforming to regular expressions, URI’s, … DTD’s are defined in non-XML syntax => XML applications need XML processing and Backus Naur processing. Can not use XML tools! Problems with DTD’s (cont)

XML Schema W3C Recommendation – Very complex standard –The only specification I know of that has a primer Expressed in XML –All tags are in the namespace –Can be manipulated by standard XML tools

Interoperability & Extensibility XML schema are building blocks to interoperability between multiple data sources –Enforces shared markup E.g., a must have a and –Enforces shared types E.g. - age must be a number between 0 and 120 XML schema are building blocks for extensibility –Reuse –Type derivation Do xml schema express meaning or just data format? What is meaning?