Introduction to XML. What is XML? Extensible Markup Language XML 1.0 1998 Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
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.
An Introduction to XML Based on the W3C XML Recommendations.
History Leading to XHTML
Tutorial 9 Working with XHTML
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Tutorial 11 Creating XML Document
COS 381 Day 14. Agenda Questions?? Resources Source Code Available for examples in Text Book in Blackboard
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:
Introduction to XML This material is based heavily on the tutorial by the same name at
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.
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
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.
WPF chapter 15 Dr. John Abraham Professor UTPA. WPF –an introduction WPF provides a single platform capable of handling graphics, audio and video. WPF.
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.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
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.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
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,
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
How do I use HTML and XML to present information?.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
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 –
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
CIS 275—Web App Dev I XML. 2 Introduction to XMLXML XML stands for ________________________. HTML was designed to display data. XML was designed to _________.
XML - DTD Week 4 Anthony Borquez. What can XML do? provides an application independent way of sharing data. independent groups of people can agree to.
Windows Presentation Foundation (WPF) Chapter 16 Dr. Abraham.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
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
XML EXtensible Markup Language. Agenda Introduction to XML XML Rules XML Elements XML Attributes XML Validation XML Exercises XML Namespaces XML CDATA.
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.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
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.
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
CIS 375—Web App Dev II XSD. 2 XSD IntroductionIntroduction XSD stands for XML __________ Definition, which is the XML-based alternative to ______. An.
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 –
Well Formed XML The basics. A Simple XML Document Smith Alice.
Introduction to DTD A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XML DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
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.
XML Introduction to XML Extensible Markup Language.
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.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML intro. 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.
XML BASICS and more…. What is XML? In common:  XML is a standard, simple, self-describing way of encoding both text and data so that content can be processed.
Introduction to XML.
Presentation transcript:

Introduction to XML

What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a text-based markup language Standard for data interchange on the web Set of rules for designing semantic tags Meta-markup language to define other languages XML 1.0 Specification

XML File Sample The Wood Shop $ $39.99

HTML Example Mambo by Enrique Garcia Producer: Enrique Garcia Publisher: Sony Music Entertainment Length: 3:46 Written: 1991 Artist: Azucar Moreno

XML Describes Structure and Semantics, Not Format Mambo Enrique Garcia Sony Music Entertainment 3: Azucar Moreno

Self-Decribing Data Hello from XML Welcome to Programing XML in Java

Structured and Integrated Data XML In The Real World XML 6/1/2002 Edward Samson Ernestine Johnson

Creating XML Documents HTML, about 100 elements XML, you define your own elements HTML Browsers try to fix bad HTML code XML Processors do not make any guess about the structure of the document Well-formed XML Document is the minimal requirement Valid XML Document (DTD or XML Schema)

What is a well-formed XML Doc? A textual object is a well-formed XML Document if: –Taken as a whole, it matches the production labeled document –It meets all the well-formedness contraints given in this specification: –Each of the parsed entities which is referenced directly or indirectly whitin the document is well- formed

document ::= prolog element Misc* Prolog: ・ – –Comments -> –Processing Instructions: Element: –Root Element contains more elements –Exactly one root element Misc: –Comments –Processing Instructions –Whitespaces

Entities Part of an XML Document Hold text or binary data May refer to other entities Parsed entities are character data Unparsed entities are binary data

Tags and Elements XML Element consists of a start tag and an end tag... Tag Names –Start with a letter, an underscore or a colon (avoid using a colon) –Next characters may be letters, digits, underscore, hyphens, periods and colons (but no whitespaces) –XML Processors are case sensitive Different tags:,, –Empty Elements have only one tag: HTML :,, XHTML :,,

Attributes Name-value pairs: {STATUS, "Good Credit"} Specify additional data in start tags Attribute Names same rules as tag names Attribute Values are strings enclosed in quotation marks

Too many attributes make documents hard to read: <CUSTOMER LAST_NAME="Smith" FIRST_NAME="Sam" DATE="October 15, 2001" PURCHASE="Tomatoes" PRICE="$1.25" NUMBER="8" /> Smith Sam October 15, 2001 Tomatoes 8 $1.25

CDATA Hold character data that remains unparsed by the XML Processor Start a CDATA section: <![CDATA[ End a CDATA section: ]]>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " Using The if Statement In JavaScript <![CDATA[ var budget budget = if (budget < 0){ document.writeln("Uh oh.")} ]]> Using The if Statement In JavaScript

Document Type Definition: Specify Structure and Syntax of XML Document –

<!DOCTYPE BOOK [ ]> chapter 1 - Intro chapter 2 - Conclusion Index

Creating Document Type Declarations

Element Definition ・

Content_model ANY –Any type of content - Elements or PCDATA Child Element Lists –Name of elements in parentheses #PCDATA (Parsed Character Data) –Nonmarkup text

Example 1: Tomatoes Example 2: This is bold text

Entities XML's way of referring to a data item. Text or Binary data. General Entity –Use in the content of XML document –References start with '&' and end with ';’ Parameter Entity –Use in a DTD –References start with '%' and end with ';’ Internal Entity - Defined in XML Document External Entity - Defined in a external source: file, URI.

Example 1: &TODAY; Example 2:

Namespaces XML namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references. Definition: A namespace (or more precisely, a namespace binding) is declared using a family of reserved attributes. Such an attribute's name must either be xmlns or begin xmlns:. These attributes, like any other XML attributes, may be provided directly or by default. default

XML Document with one namespace Namespace is defined by xmlns:prefix prefix is used for the namespace The xmlns:prefix attribute is assigned to a URI. A Uniform Resource Identifier (URI) is a string of characters which identifies an Internet Resource. Every tag is prefaced with the prefix name Programing XML in Java

Using Namespaces This XML document carries information in a table: Apples Bananas This XML document carries information about a piece of furniture : African Coffee Table Instead of using only prefixes, we have added an xmlns attribute to the tag to give the prefix a qualified name associated with a namespace.

XML Schema To define a "class" of XML Documents "instance document" - XML document that conforms to a particular schema An XML alternative to DTDs

A Simple XML Document Look at this simple XML document called "note.xml": Tove Jani Reminder Don't forget me this weekend!

A DTD File The following example is a DTD file called "note.dtd" that defines the elements of the XML document above ("note.xml"): The first line defines the note element to have four child elements: "to, from, heading, body". Line 2-5 defines the to, from, heading, body elements to be of type "#PCDAT

An XML Schema The following example is an XML Schema file called "note.xsd" that defines the elements of the XML document above ("note.xml"): <xs:schema xmlns:xs=" targetNamespace=" xmlns=" elementFormDefault="qualified"> The note element is a complex type because it contains other elements. The other elements (to, from, heading, body) are simple types because they do not contain other elements.