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.

Slides:



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

What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
1 XML DTD & XML Schema Monica Farrow G30
Tutorial 9 Working with XHTML
An Introduction to XML Schema CSCI 7818 by Ming Rutar.
XML Schemas Microsoft XML Schemas W3C XML Schemas.
2/9/00 EECS 684: Current Topics in Databases1 ( W3C Working Draft 17 December 1999 )
XML Schemas Lecture 10, 07/10/02. Acknowledgements A great portion of this presentation has been borrowed from Roger Costello’s excellent presentation.
More XML namespaces, DTDs CS 431 – February 16, 2005 Carl Lagoze – Cornell University.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 6 – XML Schema School of Architecture, Design Science and Planning Faculty of.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
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.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
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
Introduction to XML: Part I By Sandeep Jangity CS 157B, Section 2 Dr. Lee.
Processing of structured documents Spring 2003, Part 3 Helena Ahonen-Myka.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
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.
E X TENSIBLE M ARKUP L ANGUAGE (XML). What is XML?  XML stands for EXtensible Markup Language  XML is mainly designed to carry (or transmit) data, not.
1 XML Schemas. 2 Useful Links Schema tutorial links:
Dr. Azeddine Chikh IS446: Internet Software Development.
Copyright © [2001]. Roger L. Costello. All Rights Reserved. 1 XML Schemas (Primer)
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
Cornell CS 502 More XML XHTML, namespaces, DTDs CS 502 – Carl Lagoze – Cornell University.
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.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
Session IV Chapter 9 – XML Schemas
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter X IXXXXXXXXXX XXXXXX.
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
More XML namespaces, DTDs CS 431 – Carl Lagoze – Cornell University.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
XML – Part III. The Element … This type of element either has the element content or the mixed content (child element and data) The attributes of the.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
An Introduction to XML Sandeep Bhattaram
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 5 XML Schema (Based on Møller and Schwartzbach,
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.
Management of XML and Semistructured Data Lecture 10: Schemas Monday, April 30, 2001.
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.
QUALITY CONTROL WITH SCHEMAS CSC1310 Fall BASIS CONCEPTS SchemaSchema is a pass-or-fail test for document Schema is a minimum set of requirements.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
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:
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
1 XML and XML in DLESE Katy Ginger November 2003.
Extensible Markup Language (XML) Pat Morin COMP 2405.
Unit 4 Representing Web Data: XML
Tutorial 9 Working with XHTML
Yaşar Tonta & Orçun Madran [yasartonta, Hacettepe University
XML QUESTIONS AND ANSWERS
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Chapter 7 Representing Web Data: XML
Introduction to XML: Part I
ece 720 intelligent web: ontology and beyond
Presentation transcript:

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 design is not appropriate for data: - Tags don’t convey meaning of the data inside the tags. - Tags are not extensible.

Motivation for XML The need for a more SGML-like markup language for representing metadata. The XML design  Separates syntax (structural representation) from  semantics - and only considers syntax. - There is no fixed set of markup tags - we may define our own tags, according to the information. The objective is to have XML as the universal format for structuring information. A formal specification of XML can be found at:

Simple XML Example John Doe Introduction to XML 12 June XYZ Foo Bar Introduction to XSL 12 June ABC XML by itself is just hierarchically structured text - We need some sort of “grammar” (for a “Book” in the example) to check for correctness - A “stylesheet” is needed to define how the data will be shown Make up your own tags Sub-elements (properties) of “Book”

DTD [Document Type Definition] It is used to describe certain classes of XML documents (similar to grammars for other languages), and thus enforces constraints on the structure of the XML document. A Valid XML document is one, which conforms to a given DTD. Example DTD: Sub-Elements have to occur in the order specified Attribute “ID” of element “Book” is a required field Title is a “Parsed Character Data” i.e. string. “+” implies one or more Authors The Bookstore element can have 0 or more Books

Problems with XML DTDs It's not XML syntax You write your XML document using one syntax and the DTD using another syntax -> inconsistent, more work for the parsers. Limited set of primitive datatypes Desire a set of datatypes compatible with those found in databases –One of the main weaknesses of DTD is its lack of support for data types beyond character strings (PCDATA). Limited support for applying constraints. Can support only constraints like “+” (1 or more occurences), “?” (0 or 1 occurences), “*” (0 or more occurences), etc. No facility for providing constraints like those found in databases (enumerations, ranges, string length, etc.)

XML Schema XML Schemas are an improvement over DTDs: –Enhanced datatypes. Wider range of primitive data types, supporting those found in databases (string, boolean, decimal, integer, date, etc.) Can create your own datatypes (complexType) –Written in the same syntax as XML documents. –Object-oriented Can derive new type definitions on the basis of old ones (refinement) –Can have further constraints on the range of data values. Examples: maxlength, precision, enumeration, maxInclusive (upper bound), minInclusive (lower bound), encoding (applies only to binary)

An important diversion: Namespaces What is a Namespace ? The Namespace of an element, is the scope within which, it (and thus it’s name) is valid. (Ex. A basic block { … } in C) Why do we need Namespaces ?  If elements were defined within a global scope, it becomes a problem when combining elements from multiple documents. Name collision is hard to avoid. Modularity: If such a markup vocabulary exists which is well understood and for which there is useful software available, it is better to reuse this rather than make it again. Namespaces in XML: An XML namespace is a collection of names, identified by a URI reference. Names from XML namespaces may appear as qualified names, which contain a single colon, separating the name into a prefix and a local part. The prefix, which is mapped to a URI reference, selects a namespace

XML Schema [example revisited] <xsd:schema xmlns:xsd=“ targetNamespace=" xmlns=“ Prefix “xsd” refers to the XMLSchema namespace “xmlns” refers to the default namespace Defining the Element “Bookstore” as a complex Type Containing a sequence of 1 or more “Book” elements When referring to another Element, use “ref” The Author can be 1 or more Element definitions Notice the use of more meaningful data types

XSL [XML Stylesheet Language] Title Author Date ISBN An Example: TitleAuthorDateISBN Introduction to XMLJohn Doe12 June Introduction to XSLFoo Bar12 June Result: (Notice, that some fields have been filtered out from the XML file) Match the Root Element What you print out, on a Match of the root element Go through Each “Book” Element (inside a “Bookstore” Element) And, print out their Title, Author, Date, and ISBN “xsl” prefix refers to the XSL namespace

Tools/Software XML Spy By far, the most comprehensive editor. Handles XML files, DTD’s, XSL files, as well as XSD (XML Schema). Unfortunately only a 30 day trial version. XML Notepad Microsoft XML Notepad is a simple application for building and editing small sets of XML-based data. Freeware. XML Pro XML Pro is a top-notch XML editor but it doesn’t include as many features as XML Spy. Shareware. You can also validate your XML files by just opening them with IE5.0 or above. It checks if the XML file is well-formed or not, and also validates against a DTD (if specified on the DOCTYPE declaration Some nice & short Tutorials on XML/XSL/DTD/XML Schemas can be found at: