The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.

Slides:



Advertisements
Similar presentations
CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
Advertisements

The eXtensible Markup Language (XML) An Applied Tutorial Kevin Thomas.
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.
© De Montfort University, XML – a meta language Howell Istance and Peter Norris School of Computing De Montfort University.
XML 6.3 DTD 6. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:  Elements.
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.
Tutorial 9 Working with XHTML
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
Document Type Definitions
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
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:
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
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
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.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
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.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
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 Syntax - Writing XML and Designing DTD's
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
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.
These Questions are copied from
 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
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.
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.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
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.
CIS 451: XML DTDs Dr. Ralph D. Westfall February, 2009.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
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 Dr Alexiei Dingli XML Technologies DTD. 2 Document Type Definition Defines –the legal building blocks of an XML document –the document structure –The.
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.
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.
225 City Avenue, Suite 106 Bala Cynwyd, PA , phone , fax presents… XML Syntax v2.0.
Well Formed XML The basics. A Simple XML Document Smith Alice.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
XML Document Type Definitions and the Document object model.
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.
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 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.
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.
Tutorial 9 Working with XHTML
Session III Chapter 6 – Creating DTDs
14 XML.
Session II Chapter 6 – Creating DTDs
Allyson Falkner Spokane County ISD
Review of XML IST 421 Spring 2004 Lecture 5.
Presentation transcript:

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 document Part 3: XML and supplementary technologies

Part 1: Background for XML An Extensible Markup Language (XML) document describes the structure of data XML and HTML have a similar syntax … both derived from SGML XML has no mechanism to specify the format for presenting data to the user An XML document resides in its own file with an ‘.xml’ extension

Main Components of an XML Document Elements: Attributes: Entities: < (<) Advanced Components – CData Sections – Processing Instructions

An Example XML Document An example of an well-commented XML document

The Basic Rules XML is case sensitive All start tags must have end tags Elements must be properly nested XML declaration is the first statement Every document must contain a root element Attribute values must have quotation marks Certain characters are reserved for parsing

Common Errors for Element Naming Do not use white space when creating names for elements Element names cannot begin with a digit, although names can contain digits Only certain punctuation allowed – periods, colons, and hyphens

Walking through an Example Modify the computer.xml document – Add a new element named “software” with an attribute named “language” – The attribute’s value should be the name of a programming language – Create another XML element called “IFStatment” – Use the IFStatment element to tag the following data: if (a = 0) – Close the “software” tag After you have added these new items into the XML document, parse it again to ensure that it is still well formed. Use the feedback to correct any errors.

Part 2: Legal Building Blocks of XML A Document Type Definition (DTD) allows the developer to create a set of rules to specify legal content and place restrictions on an XML file If the XML document does not follow the rules contained within the DTD, a parser generates an error An XML document that conforms to the rules within a DTD is said to be valid

Why Use a DTD? – A single DTD ensures a common format for each XML document that references it – An application can use a standard DTD to verify that data that it receives from the outside world is valid – A description of legal, valid data further contributes to the interoperability and efficiency of using XML

Some Example DTD Declarations Example 1: The Empty Element Example 2: Elements with Data April This is a month Jan March

Some Example DTD Declarations Example 3: Elements with Children To specify that an element must have a single child element, include the element name within the parenthesis Preston Ave Charlottesville Va An element can have multiple children. A DTD describes multiple children using a sequence, or a list of elements separated by commas. The XML file must contain one of each element in the specified order. John Doe 1234 Preston Ave. Charlottesville, Va 22903

Cautions concerning DTDs All element declarations begin with The ELEMENT declaration is case sensitive The programmer must declare all elements within an XML file Elements declared with the #PCDATA content model can not have children When describing sequences, the XML document must contain exactly those elements in exactly that order.

Walking Through an Example Using the file “music.xml” contained in the extras folder, create a Document Type Definition that describes all of the elements. The goals for this exercise are to: – map out the elements – define each element – pick the best content model for each element – correctly order the elements using sequences Internally embed the DTD within the XML document