Cornell CS 502 More XML XHTML, namespaces, DTDs CS 502 – 20020212 Carl Lagoze – Cornell University.

Slides:



Advertisements
Similar presentations
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
Advertisements

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
Tutorial 9 Working with XHTML
XHTML 16-Apr-17.
XML Study-Session: Part II Validating XML Documents.
An Introduction to XML Schema CSCI 7818 by Ming Rutar.
1 Lecture 10 XML Wednesday, October 18, XML Outline XML (4.6, 4.7) –Syntax –Semistructured data –DTDs.
XML Schemas Lecture 10, 07/10/02. Acknowledgements A great portion of this presentation has been borrowed from Roger Costello’s excellent presentation.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
More XML namespaces, DTDs CS 431 – February 16, 2005 Carl Lagoze – Cornell University.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
More XML XML schema, XPATH, XSLT CS 431 – February 21, 2005 Carl Lagoze – Cornell University acknowledgements to
1 CS 502: Computing Methods for Digital Libraries Lecture 6 DTDs.
Sunday, June 28, 2015 Abdelali ZAHI : FALL 2003 : XML Schemas XML Schemas Presented By : Abdelali ZAHI Instructor : Dr H.Haddouti.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
XML Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
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.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
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.
1 XML Schemas. 2 Useful Links Schema tutorial links:
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
Introduction to XML. What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.
XML Extensible Markup Language. What is XML? ● meta-markup language ● a language for defining a family of languages ● semantic/structured mark-up language.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
XML - Why: The HTML-Dilemma HTML, SGML, XML - How: Syntax, Concept, Language Elements Basics Well-formed XML-Documents (without DTD) Valid XML-Documents.
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.
Session IV Chapter 9 – XML Schemas
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
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.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
CIS 451: XML DTDs Dr. Ralph D. Westfall February, 2009.
An OO schema language for XML SOX W3C Note 30 July 1999.
More XML namespaces, DTDs CS 431 – Carl Lagoze – Cornell University.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
An Introduction to XML Sandeep Bhattaram
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
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.
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.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
 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:
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.
1 Introduction to XML Babak Esfandiari. 2 What is XML? introduced by W3C in 98 Stands for eXtensible Markup Language it is more general than HTML, but.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML QUESTIONS AND ANSWERS
Web Programming Maymester 2004
More XML XML schema, XPATH, XSLT
Presentation transcript:

Cornell CS 502 More XML XHTML, namespaces, DTDs CS 502 – Carl Lagoze – Cornell University

Cornell CS 502 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 –Semantics: xml schema, rdf schema, etc.

Cornell CS 502 DTD – Document Type Definition Artifact of XML’s roots in SGML Useful for: –Document Interchange –Document Authoring Association of DTD with XML document declares that is an instance of that DTD –DOCTYPE tag –Must follow XML declaration before any elements

Cornell CS 502 Constructing a DTD: Entities XML document consists of units called entities Using entities simple abbreviations –Entity creation in DTD Carl Lagoze –Entity use in XML document &me; Using entities for inter-DTD modularity –Entity creation in DTD

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

Cornell CS 502 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

Cornell CS 502 Constructing a DTD - Attributes Attributes are a way of associating properties with elements –Think of them as a refinement method Example attribute declaration <!ATTList Book ISBN ISBN ID#REQUIRED levelCDATA#IMPLIED cover(soft | hard) #REQUIRED >

Cornell CS 502 <!DOCTYPE Book [ <!ATTLIST author birthday CDATA #IMPLIED sex (male|female) #IMPLIED> ]> Kevin Davies Cracking the Genome €

Cornell CS 502 xHTML An application of XML Corrects defects in HTML –All tags closed –Proper nesting –Case sensitive (all tags lower case) –Strict well-formedness Defined by a DTD –Strict –Transitional –Frameset –

Cornell CS 502 xHTML (cont.) All new HTML SHOULD be xHTML W3C validator – Tidy –

Cornell CS 502 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

Cornell CS 502 My home page My hobby My books Kevin Davies Cracking the Genome 20.00

Cornell CS 502 My home page My hobby My books Kevin Davies Cracking the Genome 20.00

Cornell CS 502 My home page My hobby My books Kevin Davies Cracking the Genome 20.00

Cornell CS 502 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?

Cornell CS 502 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.

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

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

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

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

Cornell CS 502 What to 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

Cornell CS 502 XML – XML schema Problems with XML DTD’s: DTD’s are not extensible: all rules must be present IN the DTD. 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

Cornell CS 502 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)

Cornell CS 502 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

Cornell CS 502 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?