XML Open Computing Institute, Inc. 1 eXtensible Markup Language (XML)

Slides:



Advertisements
Similar presentations
XML I.
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:
An Introduction to XML Based on the W3C XML Recommendations.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
Document Type Definition DTDs CS-328. What is a DTD Defines the structure of an XML document Only the elements defined in a DTD can be used in an XML.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
XML A brief introduction ---by Yongzhu Li. XML --- a brief introduction 2 CSI668 Topics in System Architecture SUNY Albany Computer Science Department.
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.
Tutorial 11 Creating XML Document
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
XML – Extensible Markup Language Sivakumar Kuttuva & Janusz Zalewski.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
Validating DOCUMENTS with DTDs
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 XML Taken from Chapter 7.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
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.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
Document Type Definitions Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
XML Extensible Markup Language. What is XML? ● meta-markup language ● a language for defining a family of languages ● semantic/structured mark-up language.
XML Syntax - Writing XML and Designing DTD's
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.
Introduction to XML Extensible Markup Language. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information.
 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,
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 6 – Document Type Definition (DTD) Outline 6.1Introduction 6.2Parsers, Well-formed and Valid XML.
Lecture 6 XML DTD Content of.xml fileContent of.dtd file.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language  XML is a markup language for creating documents containing structured information.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
XML Extensible Markup Language Aleksandar Bogdanovski Programing Enviroment LABoratory
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
1 Introduction to XML XML stands for Extensible Markup Language. Because it is extensible, XML has been used to create a wide variety of different markup.
An Introduction to XML Sandeep Bhattaram
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Understanding How XML Works Ellen Pearlman Eileen Mullin Programming the.
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
1/11 ITApplications XML Module Session 3: Document Type Definition (DTD) Part 1.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
An Introduction to XML Paul Donohue May 8th 2002 Hotel Senator Zürich.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
SNU OOPSLA Lab. Logical structure © copyright 2001 SNU OOPSLA Lab.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
QUALITY CONTROL WITH SCHEMAS CSC1310 Fall BASIS CONCEPTS SchemaSchema is a pass-or-fail test for document Schema is a minimum set of requirements.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XML Technology. Emerging Importance of XML –HTML-tagging is display oriented. –XML-based content tagging has important uses: data mining role-oriented.
Document Type Definition (DTD) Eugenia Fernandez IUPUI.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
XP 1Creating Web Pages with XML Tutorial 1 New Perspectives on XML Tutorial 1 – Creating an XML Document.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
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.
Session III Chapter 6 – Creating DTDs
Creating an XML Document
Session II Chapter 6 – Creating DTDs
Document Type Definition (DTD)
Presentation transcript:

XML Open Computing Institute, Inc. 1 eXtensible Markup Language (XML)

XML Open Computing Institute, Inc. 2 What is XML? eXtensible Markup Language Subset of SGML (Standardized General Markup Language) – marks up content, not formatting, just like SGML – omits complex features Formatting is done with – Cascading Style Sheets (CSS) – eXtensible Style Language (XSL) Relationship to HTML – can express the rules for HTML in an XML Document Type Definition (DTD) – HTML documents can be XML documents have a single root element ( ) close all tags enclose attribute values in quotes

XML Open Computing Institute, Inc. 3 Some Benefits of Using XML XML documents are self-describing – not just a collection of data values Can use standard XML tools (& some SGML tools) to create, modify, process and view – XML editors – SAX and DOM programming interfaces – XML-aware browsers Can use a DTD to constrain structure and allowed values Can use XSL to read existing XML documents and create new ones with a different structure – when needs change – when other applications expect the data to be structured differently Errors in data don’t prevent use of other document data as long as it is still well-formed

XML Open Computing Institute, Inc. 4 Some Design Goals For XML Compatible with SGML – take advantage of existing expertise and some existing tools Optional elements kept to a minimum – comparison of spec. sizes: SGML ~500 pages, XML ~30 pages Human-readable, like HTML Easy to create documents Terseness of markup is of little importance – element and attribute names take up a lot of space but compresses well (~90%) Support a variety of applications, not just web browsers Easy to write applications that process XML documents – can use SAX and DOM interfaces

XML Open Computing Institute, Inc. 5 Custom Markup Languages XML is used to create markup languages for specific applications Examples – Chemical Markup Language (CML) for displaying molecule descriptions and trees and model diagrams –––––––––– FDX - for footwear industry data FpML and FinXML - for securities trading data HL7 - for health care data MathML - for mathematical equations Open Financial eXchange (OFX) for personal financial data like that stored in Quicken or Money also supports consumer and small business banking and bill payment – Open Software Distribution (OSD) for software distribution and updates

XML Open Computing Institute, Inc. 6 Categorizing The Pieces Basics: Validating: Links: Formatting: Programming: XML DTD and XML Schema XLink and XPointer CSS and XSL SAX and DOM

XML Open Computing Institute, Inc. 7 XML Elements (or tags) Must be surrounded by characters Must be terminated in one of two ways content goes here Can include attributes Can contain child elements St. Louis Missouri Child elements must be properly nested – proper: – improper:

XML Open Computing Institute, Inc. 8 Example XML Document Mark Volkmann Cranberries Everybody Else Is Doing It, So Why Can't We? I Still Do 3:16 Dreams 4:32 prolog section XML declaration root element document type declaration an XML comment

XML Open Computing Institute, Inc. 9 Well-formed & Valid XML Documents Well-formed documents – all elements are terminated – one element, the root element, contains all the others – elements do not overlap child elements must be closed before their parent is closed – attribute values are enclosed in quotes – < is only used to start elements – also a few rules about entities entities are shorthand names for replacement text entities can also refer to non-XML data Valid documents – well-formed – conform to a DTD

XML Open Computing Institute, Inc. 10 Document Type Definitions (DTD) A DTD defines –––––––––– allowed elements and their attributes valid element nesting relationships sequence in which elements must appear within their parent element number of times elements can occur within their parent element and more Only needed for “valid” documents, not for merely “well-formed” documents DTDs for many application domains already exist Four DTD types – ELEMENT, ATTLIST, ENTITY and NOTATION identifies the application to be used for processing data in a given format

XML Open Computing Institute, Inc. 11 Element Definitions Four types of element definitions – no content - EMPTY – only text content, no child elements - (#PCDATA) – only child elements, no text content - requires a content model – any content - ANY Element content models – typically a sequence of child elements separated by commas – special characters indicate the number of occurrences allowed ? means 0 or 1, * means 0 or more, + means 1 or more, default is 1 – example: (a*,b+,c?,(d|e)) specifies 0 or more a elements, followed by one or more b elements, followed by 0 or 1 c elements, followed by one d or e element Parsed Character Data

XML Open Computing Institute, Inc. 12 Attributes Ten types of attribute definitions – enumerated - list of allowed values; example: (red|green|blue) – CDATA - any characters – NMTOKEN - only characters allowed in “name tokens” letters, digits, underscore, hyphen, period and colon; begin with a letter –––––––––––––– NMTOKENS - a white space-separated list of NMTOKEN values ID - unique identifier for the element within the XML document IDREF - refers to another element within the same XML document IDREFS - a white space-separated list of IDREF values ENTITY - refers to an unparsed external entity such as an image file ENTITIES - a white space-separated list of ENTITY values NOTATION - identifies the data format of an unparsed external entity Attributes can be required ( #REQUIRED ), optional ( #IMPLIED ) or have default values

XML Open Computing Institute, Inc. 13 Example DTD <!ELEMENT musicCollection (owner, artist*)> artist (name, cd*)> cd (title, track*)> track (name, time?)> name (#PCDATA)> owner (#PCDATA)> time (#PCDATA)> title (#PCDATA)> <!ATTLIST cd category (classical|country|jazz|pop|rock|other) #REQUIRED import (true|false) "false" year CDATA #IMPLIED >

XML Open Computing Institute, Inc. 14 XML Schema W 3 C proposed schema language alternative to DTDs – a superset of the DTD capabilities – combines the best features of other similar proposals XML-Data, XDR, DCD, SOX, DDML – uses XML syntax instead of a unique syntax like DTDs can edit, validate, and transform using standard XML tools Created by the W 3 C XML Schema Working Group – see XML Schema Part 1: Structures W 3 C Working Draft 6-May-1999 and XML Schema Part 2: Datatypes W 3 C Working Draft 6-May-1999

XML Open Computing Institute, Inc. 15 XML Schema (Cont’d) Some XML Schema improvements over DTDs – built-in datatypes string, boolean, number, dateTime, binary (ex. image data), uri integer, decimal, real, date, time, timePeriod – user-generated datatypes (built-in datatypes with “constraining facets”) string supports length (for fixed-length), maxlength (for variable-length), and COBOL-like pictures or Perl-like regular expressions to constrain format number supports minInclusive, minExclusive, maxInclusive and maxExclusive – integer, decimal and real are all number s – limits on number of occurrences of child elements minOccur can be set to a number (0 or more) maxOccur can be set to a number (1 or more) or "*" for unlimited

XML Open Computing Institute, Inc. 16 XLink Provides greater linking capabilities than HTML Any element can serve as a link – no special element, just special attributes Features – simple links unidirectional link to a single resource (like HTML links) – extended links bi-directional link to one or more resources can be defined in a separate file to allow multiple files to share the link – activate with “ user ” (user click) or “ auto ” (when page is loaded) – show with “ replace ” (replace current page), “ new ” (display in a new window) or “ embed ” (embed into current page) – custom behaviors when link is activated (ex. sounds and transition effects)

XML Open Computing Institute, Inc. 1 eXtensible Markup Language (XML) -- END --