 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 1 Chapter 20 – Extensible Markup Language (XML) Outline 20.1 Introduction 20.2 Structuring.

Slides:



Advertisements
Similar presentations
XML: Extensible Markup Language
Advertisements

An Introduction to XML Based on the W3C XML Recommendations.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 24.
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
1 Introduction to XML. XML eXtensible implies that users define tag content Markup implies it is a coded document Language implies it is a metalanguage.
©Silberschatz, Korth and Sudarshan10.1Database System Concepts W3C Activities HTML: is the lingua franca for publishing on the Web XHTML: an XML application.
1 Extensible Markup Language: XML HTML: portable, widely supported protocol for describing how to format data XML: portable, widely supported protocol.
XML A brief introduction ---by Yongzhu Li. XML --- a brief introduction 2 CSI668 Topics in System Architecture SUNY Albany Computer Science Department.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
XML by Jon Pearce. What is XML? XML = eXstensible Markup Language = a meta language for defining markup languages. Examples: MathML, SVG (Scalable Vector.
COS 381 Day 16. Agenda Assignment 4 posted Due April 1 There was no resubmits of Assignment Capstone Progress report Due March 24 Today we will discuss.
 2008 Pearson Education, Inc. All rights reserved XML and RSS.
 2008 Pearson Education, Inc. All rights reserved XML.
XML at Work John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: (x2073)
 2001 Deitel & Associates, Inc. All rights reserved. 1 Chapter 27 – XML (Extensible Markup Language) Outline 27.1Introduction 27.2Structuring Data 27.3Document.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
Scientific Markup Languages Birds of a Feather A 10-Minute Introduction to XML Timothy W. Cole Mathematics Librarian & Professor of.
1 XML at a neighborhood university near you Innovation 2005 September 16, 2005 Kwok-Bun Yue University of Houston-Clear Lake.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
XML: Overview MIS 181.9: Service Oriented Architecture 2 nd Semester,
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.
Introduction to XML Eugenia Fernandez IUPUI. What is XML? From the World Wide Web Consortium (W3C) The Extensible Markup Language (XML) is the universal.
 2008 Pearson Education, Inc. All rights reserved XML and RSS.
Another PillowTalk Presentation  2004 Dynamic Systems, Inc. Introduction to XML for SOA Lee H. Burstein,
 2003 Prentice Hall, Inc. All rights reserved. Chapter 20 – Extensible Markup Language (XML) Outline 20.1 Introduction 20.2 Structuring Data 20.3 XML.
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan.
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.
Web Services Description Language (WSDL) Jason Glenn CDA 5937 Process Coordination in Service and Computational Grids September 30, 2002.
 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,
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
Session IV Chapter 9 – XML Schemas
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
Electronic Commerce COMP3210 Session 4: Designing, Building and Evaluating e-Commerce Initiatives – Part II Dr. Paul Walcott Department of Computer Science,
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.
XML Extensible Markup Language
XML – An Introduction Structured Data Mark-up James McCartney CSCE 590, Cluster and Grid Computing.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Scripting with the DOM Ellen Pearlman Eileen Mullin Programming the Web.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 20 – Extensible Markup Language (XML) Outline 20.1 Introduction 20.2 Structuring Data 20.3 XML.
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.
An Introduction to XML Paul Donohue May 8th 2002 Hotel Senator Zürich.
XML, XSL, and SOAP Building Object Systems from Documents CSC/ECE 591o Summer 2000.
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.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
COP 3813 Intro to Internet Computing Prof. Roy Levow XML.
Chapter 15: XML TP2543 Web Programming Mohammad Faidzul Nasrudin.
©Silberschatz, Korth and Sudarshan10.1Database System Concepts W3C - The World Wide Web Consortium W3C - The World Wide Web Consortium.
Martin Kruliš by Martin Kruliš (v1.1)1.
Working with XML. Markup Languages Text-based languages based on SGML Text-based languages based on SGML SGML = Standard Generalized Markup Language SGML.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
 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:
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
1 XML and RSS. 2 Knowing trees, I understand the meaning of patience. Knowing grass, I can appreciate persistence. — Hal Borland Like everything metaphysical,
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
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.
Unit 4 Representing Web Data: XML
XML Related Technologies
XML in Web Technologies
Database Processing with XML
14 XML and RSS.
Chapter 7 Representing Web Data: XML
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Chapter 20 – Extensible Markup Language (XML)
14 XML.
Presentation transcript:

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 1 Chapter 20 – Extensible Markup Language (XML) Outline 20.1 Introduction 20.2 Structuring Data 20.3 XML Namespaces 20.4 Document Type Definitions (DTDs) and Schemas Document Type Definitions W3C XML Schema Documents 20.5 XML Vocabularies MathML Chemical Markup Language (CML) MusicXML RSS Other Markup Languages 20.6 Document Object Model (DOM) 20.7 DOM Methods 20.8 Simple API for XML (SAX) 20.9 Extensible Stylesheet Language (XSL) Simple Object Access Protocol (SOAP) Web Services Water XML-Based Programming Language Web Resources

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 2 Objectives In this lesson, you will learn: –To understand XML. –To be able to mark up data using XML. –To become familiar with the types of markup languages created with XML. –To understand the relationships among DTDs, Schemas and XML. –To understand the fundamentals of DOM-based and SAX-based parsing. –To understand the concept of an XML namespace. –To be able to create simple XSL documents. –To become familiar with Web services and related technologies.

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Introduction XML (Extensible Markup Language) –Derived from Standard Generalized Markup Language (SGML) –Open technology for electronic data exchange and storage –Create other markup languages to describe data in structured manner –XML documents Contain only data, not formatting instructions Highly portable Typically ends with.xml file extension, any text editor can view and edit. It is both human readable and machine readable Processing an XML document requires an XML parser Support Document Object Model or Simple API XML Document Type Definition (DTD, schema) –XML document can reference another that defines proper structure –XML-based markup languages XML vocabularies

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Structuring Data XML declaration –version Attribute Indicates the XML version to which the document conforms Root element –Element that encompasses every other elements Container element –Any element contains other elements Child elements –Elements inside a container element Empty element flag –Does not contain any text DTD documents –End with.dtd extension

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline article.xml (1 of 1)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 6

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 7 Container element Child elements

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline letter.xml (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline letter.xml (2 of 2)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 10

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 11

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide XML Namespaces XML –Allows document authors to create custom elements –Can result in Naming collisions –XML namespace Collection of element and attribute names Uniform resource identifier (URI) –Uniquely identifies the namespace –A string of text for differentiating names Any name except for reserved namespace xml Directory –Root element and contains other elements

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline namespace.xml (1 of 1)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline defaultnamespace.xml (1 of 1)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Document Type Definitions (DTDs) and Schemas Two types of documents for specifying XML document structure –Document Type Definition (DTDs) –Schemas

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Document Type Definitions Enables XML parser to verify whether XML document is valid Allow independent user groups to check structure and exchange data in standardized format Expresses set of rules for structure using EBNF grammar ELEMENT type declaration –Defines rules ATTLIST attribute-list declaration –Defines an attribute

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline letter.dtd (1 of 1)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide W3C XML Schema Documents Schemas –Specify XML document structure –Do not use EBNF grammar –Use XML syntax –Can be manipulated like other XML documents –Require validating parsers –XML schemas Schema vocabulary the W3C created Recommendation Schema valid –XML document that conforms to a schema document –Use.xsd extension

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide W3C XML Schema Documents Root element schema –Contains elements that define the XML document structure –targetNamespace Namespace of XML vocabulary the schema defines –element tag Defines element to be included in XML document structure –name and type attributes Specify element’s name and data type respectively –Built-in simple types date, int, double, time, etc

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide W3C XML Schema Documents Two categories of data types –Simple types Cannot contain attributes or child elements –Complex types May contain attributes and child elements complexType –Define complex type Simple content –Cannot have child elements Complex content –May have child elements

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline book.xml (1 of 1)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline book.xsd (1 of 1)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 23

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 24 XSD Schema Validator

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 25 XSV Schema Validator

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline computer.xsd (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline computer.xsd (2 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline laptop.xml (1 of 1)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide XML Vocabularies XML allows us to create our own tags to describe precisely. People and organizations have created many different kinds of XML for structuring data, some of these are: –MathML (Mathematical Markup Language) –SVG (Scalable Vector Graphics) –WML (Wireless Markup Language) –XBRL (Extensible Business Reporting Language) –XUL (Extensible User Interface Language) –PDML (Product Data Markup Language)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide XML Vocabularies W3C XML Schema XSL (Extensible Stylesheet Language)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide MathML Describe mathematical notations and expressions MathML markup –Content markup Provides tags that embody mathematical concepts Allows programmers to write mathematical notation specific to different areas of mathematics Distinguishes between different uses of same symbol –Presentation markup Directed towards formatting and displaying mathematical notation

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline mathml1.html (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline mathml1.html (2 of 2) MathML displayed in the Amaya browser. [Courtesy of World Wide Web Consortium (W3C).]

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline mathml2.html (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline mathml2.html (2 of 2) MathML displayed in the Amaya browser. [Courtesy of World Wide Web Consortium (W3C).]

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline mathml3.html (1 of 3)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline mathml3.html (2 of 3)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline mathml3.html (3 of 3) Integral symbol Delta symbol MathML displayed in the Amaya browser. [Courtesy of World Wide Web Consortium (W3C).]

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Chemical Markup Language (CML) XML vocabulary for representing molecular and chemical information

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline ammonia.xml (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline ammonia.xml 2 of 2 (Courtesy of the Jmol Project.)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide MusicXML Music distribution Simplifies exchange of musical scores over Internet Developed by Recordare Mark up all type of music DTD –Less powerful than Schema –Simpler to program Relies heavily on elements rather than attributes

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide MusicXML Fig MusicXML markup rendered by Finale 2003 (Courtesy of MakeMusic! Inc.).

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide RSS RDF Site summary Popular and simple XML format designed to share headlines and Web content between Web sites RSS file –RSS feed –Container rss element Denotes the RSS version –Container channel elements Descriptive tags Item elements –Describe the news or information –title element –description element –link element

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline deitel.rss (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline deitel.rss (2 of 2)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Other Markup Languages

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Document Object Model (DOM) Document Object Model (DOM) tree –Nodes –Parent node Ancestor nodes –Child node Descendant nodes Sibling nodes –One single root node Contains all other nodes in document Application Programming Interface (API)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Document Object Model (DOM) firstName lastName contents summary author date title article children of the article root node siblings root element Fig Tree structure for article.xml.

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide DOM Methods nodeName –Name of an element, attribute, or so on NodeList –List of nodes –Can be accessed like an array using method item Property length –Returns number of children in root element nextSibling –Returns node’s next sibling nodeValue –Retrieves value of text node parentNode –Returns node’s parent node

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline DOMExample.html (1 of 3)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline DOMExample.html (2 of 3)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline DOMExample.html (3 of 3)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 54

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide DOM Methods

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide DOM Methods

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide DOM Methods

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide DOM Methods

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide DOM Methods

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Simple API for XML (SAX) Developed by members of XML-DEV mailing list Parse XML documents using event-based model Provide different APIs for accessing XML document information Invoke listener methods Passes data to application from XML document Better performance and less memory overhead than DOM- based parsers

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Extensible Stylesheet Language (XSL) Specify how programs should render XML document data –XSL-FO (XSL Formatted Objects) Vocabulary for specifying formatting –XSLT (XSL Transformation) Source tree Result tree –Xpath Locate parts of the source tree document that match templates defined in the XSL stylesheet

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Extensible Stylesheet Language (XSL)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline games.xml (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline games.xml (2 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline games.xsl (1 of 3)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline games.xsl (2 of 3)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline games.xsl (3 of 3)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline sorting.html (1 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline sorting.html (2 of 2)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline sorting.xsl (1 of 4)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline sorting.xsl (2 of 4)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline sorting.xsl (3 of 4)

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline sorting.xsl (4 of 4)

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Simple Object Access Protocol (SOAP) Developed by IBM, Lotus Development Corporation, Microsoft, DevelopMentor, and Userland Software XML-based protocol Allows applications to communicate over Internet SOAP message –Envelope A structure describes a method call –Body Request –Remote Procedure Call (RPC) Response –HTTP response document contains results from other method call

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Web Services Standards –XML –SOAP –Web Services Description Language (WSDL) –Universal Description, Discovery and Integration (UDDI) –Modular programming Modularization –Less error prone and promotes software reuse

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Web Services

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Water XML-Based Programming Language Simplifies XML and Web services programming Represents all objects and data as XML

 2003 Prentice Hall, Inc. All rights reserved. Outline  2003 Prentice Hall, Inc. All rights reserved. Outline concatenate.h2o 1 of 1

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide 79

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Web Resources xml.apache.org wdvl.internet.com/Authoring/Languages/XML msdn.microsoft.com/xml/default.asp developer.netscape.com/tech/xml/index.html

 2003 Prentice Hall, Inc. All rights reserved. 3 rd Edition Slide Web Resources backend.userland.com/rss