Chapter 2: Well-Formed XML. Chapter 2 Objectives How to create SML elements using start- tags and end-tags How to further describe elements with attributes.

Slides:



Advertisements
Similar presentations
Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
Advertisements

© 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.
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
XML Study-Session: Part I Writing a XML Document.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
Document Type Definitions
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
XML Fundamentals Transparency No. 1 XML Fundamentals Cheng-Chia Chen November 2004.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
XML Basics Hope Greenberg Center for Teaching & Learning.
Topics The "bigger picture" –The "XML sales pitch" –XML/XHTML vs. SGML/HTML –XML in electronic publishing –XML and the future, web 2.0 XML basics: –Building.
Copyright © 2003 Pearson Education, Inc. Slide 2-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
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.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
1/14 ITApplications XML Module Session 2: Using and Creating XML Documents.
XML - DTD. The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA.
XML – 1h. XML: Contents What is XML? What is “Well Formed” XML? What is “Valid” XML? –Document Type Definitions –Scalable Vector Graphics (SVG) XML in.
Introduction to XML 1. XML XML started out as a standard data exchange format for the Web Yet, it has quickly become the fundamental instrument in the.
Introduction to XML. What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
August Chapter 2 - Markup and Core Concepts Learning XML by Erik T. Ray Slides were developed by Jack Davis College of Information Science and Technology.
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 Extensible Markup Language. What is XML? An infrastructure for describing text and data Developed by W3C(the World Wide Web Consortium)
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,
Session IV Chapter 9 – XML Schemas
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
How do I use HTML and XML to present information?.
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.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation An Introduction to XML.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
XML 2 Prepared by / Nael Alian Uinverity of Palestine Re. 1.
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.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
Appendix C: Brief Overview of XML. ©SoftMoore ConsultingSlide 2 What is XML? The eXtensible Markup Language (XML) is a meta-markup language; i.e., a language.
2 XML Syntax XML Document Structure August 15, :00 Darmstadt Hessen Germany fine 25 SW 6 Markup Content.
Web Technologies COMP6115 Session 4: Adding a Database to a Web Site Dr. Paul Walcott Department of Computer Science, Mathematics and Physics University.
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.
What it is and how it works
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 Basics A brief introduction to XML in general 1XML Basics.
Jennifer Widom XML Data Introduction, Well-formed XML.
Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
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 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.
Games: XML Presented by: Idham bin Mat Desa Mohd Sharizal bin Hamzah Mohd Radzuan bin Mohd Shaari Shukor bin Nordin.
Unit 8 XML Documents. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Characters and white.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
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.
WELL- FORMEDNESS CH 6. Objective Well-formedness rules Text in XML Elements and Tags in Atributes Entity references CDATA sections Comments Unicode XML1.1.
Unit 4 Representing Web Data: XML
The XML Language.
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
Allyson Falkner Spokane County ISD
Presentation transcript:

Chapter 2: Well-Formed XML

Chapter 2 Objectives How to create SML elements using start- tags and end-tags How to further describe elements with attributes How to declare your document as being XML How to send instructions to applications that are processing the XML document Which characters aren’t allowed in XML – and how to use them in your documents anyway!

Parsing XML

Tags and Text and Elements, Oh My! John Fitzgerald Johanson Doe is a start-tag is and end-tag John is an element

Try It Out Creating a Distribution Process

Rules for Elements ❑ Every start-tag must have a matching end-tag, or be a self- closing tag. ❑ Tags can’t overlap; elements must be properly nested. ❑ XML documents can have only one root element. ❑ Element names must obey XML naming conventions. ❑ XML is case sensitive. ❑ XML will keep whitespace in your PCDATA.

Rules for Elements Bad Example John Jane Good Example John Jane

Rules for Elements Names can start with letters, no numbers After first character, numbers, hyphens and periods are allowed Names can’t contain spaces There are reserved characters like “:” Names can’t start with the letters “xml”, “XML”, or “Xml”, or any other combination No spaces after the “ ” if desired

Rules for Elements These are two different elements John

Rules for Elements Whitespace stripping takes place in HTML… This is a paragraph. It has a whole bunch of space. …but not in XML Example This is a paragraph. It has a whole Bunch of space. This is a paragraph. It has a whole Bunch of space.

Rules for Elements Windows uses both the line feed and the carriage return UNIX uses only line feed XML parsers will convert all Windows “line feed and carriage returns” to just line feed characters to standardize end-of-line logic

Rules for Elements This is some XML This is known as extraneous whitespace in the markup.

Attributes John Fitzgerald Johansen Doe

Why use attributes There is nothing that an attribute can do that an element can’t, but not vice-versa They can be handy for “meta” data Suppose you wanted to include the number of individual orders? They are smaller than elements, but Attributes are unordered Some people just like them

Try It Out Adding Attributes to Our Orders

Comments John Doe

Try It Out Some Comments on Orders

Empty Elements John Doe

XML Declaration John Doe

Try It Out Declaring Our Orders to the World

Processing Instructions John Doe

Illegal PCDATA Characters 6 is 6

Escaping Characters 6 is < 7 & 7 > 6

CDATA Sections <![CDATA[ function myFunc() { if(0 < 1 && 1 < 2) alert(“Hello”); } ]]>

Try It Out Talking about HTML in XML

Errors in XML Errors Violations May recover Continue processing Fatal errors Draconian error handling Not allowed to continue

Try It Out Adding Attributes to Our Orders Some Comments to Our Orders Declaring Our Orders To The World An Order To Be Processes Talking About HTML in XML