XML eXtensible Markup Language. HTML is not extensible One defect of HTML is that it is not extensible In HTML we cannot, for example, define notions.

Slides:



Advertisements
Similar presentations
Chapter 7 An Introduction to XML.
Advertisements

CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
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.
© De Montfort University, XML – a meta language Howell Istance and Peter Norris School of Computing De Montfort University.
Document Type Definitions and Schemata We have seen several ways of using XML to markup a poem, but we could invent a host of other possible approaches.
XML XML What XML is and what it means to me as a Computer Scientist By: Derek Edwards CS 376 March 10, 2003.
XML eXtensible Markup Language. HTML is not extensible One defect of HTML is that it is not extensible In HTML we cannot, for example, define notions.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
XHTML. XHTML is one of the many XML-based languages that have been defined XHTML is, essentially, a “cleaned-up” version of HTML 4, reformulated using.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Valid XML documents (contd.) For example, if we wanted to turn the example well- formed XML document we have just seen into a valid document, we would.
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.
Sistemi basati su conoscenza XML Prof. M.T. PAZIENZA a.a
Tutorial 11 Creating XML Document
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
XML Introduction By Hongming Yu Feb 6 th, Index Markup Language: SGML, HTML, XML An XML example Why is XML important XML introduction XML applications.
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
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
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.
Marco Mesiti Dep. of Computer Science University of Genova XML eXtensible Markup Language.
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.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
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.
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.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
FIGIS’ML Hands-on training - © FAO/FIGIS An introduction to XML Objectives : –what is XML? –XML and HTML –XML documents structure well-formedness.
 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 A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
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.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
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.
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.
XML – A Quick Introduction Kerry Raymond (stolen from others)
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
Introduction to XML February 07, From HTML to XML As mentioned in previous classes, if you know HTML, then you already know XML… really! In this.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
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 –
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
SCHOOL OF LIBRARY, ARCHIVE AND INFORMATION STUDIES Andy Dawson LIS1510 Library and Archives Automation Issues XML and extensible systems Andy Dawson School.
XML The Extensible Markup Language (XML ), which is comparable to SGML and modeled on it, describes how to describe a collection of data. A standard way.
Evaluation Biztalk Table of Contents Introduction to XML. Anatomy of an XML document. What is an XML Schema? What is SOAP? XML Web Services overview.
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
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.
XML QUESTIONS AND ANSWERS
Lonely as a Cloud  A LONELY PPT.
CSE591: Data Mining by H. Liu
Presentation transcript:

XML eXtensible Markup Language

HTML is not extensible One defect of HTML is that it is not extensible In HTML we cannot, for example, define notions like poem or verse or line The best we can do, if we want to markup a poem in HTML, is to “adapt” the existing tags to our own needs For example, we might –use a tag to mark the start of a poem –use and tags to mark the start and finish of a verse –use and tags to mark the start and end of lines in a verse

Trying to use HTML to markup a poem A poem might be marked up in HTML like this The Daffodils I wandered lonely as a cloud That floats on high o’er vales and hills When all at once I saw a crowd A host of golden daffodils Something something something Something something something else...

CS 4320 got here on 4 March 2003

HTML is not extensible (contd.) This poem markup is not very satisfactory For example, each line would be rendered, by default, with a bullet in front Sure, we could use CSS to overcome this But how would we markup the end of the poem? OK, we might devise some way or other But who else would know that we intend tags to markup the start of a poem, and tags to delimit verses, and so on? What about search engines? How would they find our poems? We need a way of defining new purpose-specific tags

Some History SGML –Standard Generalized Markup Language SGML has been in use for many years for marking up electronic documents SGML is actually a meta-language –it is used to define markup languages for specific applications, for example poetry legal documents etc In fact, HTML was defined using SGML

Some History (contd.) If we want extensibility, why not use SGML? –SGML is very complex –many of SGML’s features are only rarely used XML is a version of SGML which omits the rarely-used features and simplifies the tasks of –defining document types –writing programs which process documents But XML is still SGML and software for processing SGML can still be used to process XML files Indeed, it has been said by SGML people that “ XML is SGML -- not HTML ++ ”

Cs 4320 got here on 22 feb 2005

Some History (contd.) XML is a simpler version of SGML, adequate for web purposes Thus, XML is a meta-language. –that is, XML is a language that is used to define other languages. With XML, one can:  define new tags  use these to define platform-independent languages and data structures With XML one cannot specify rendering –other, related, technologies are needed for that purpose

What is XML good for? Defining new Markup Languages –eg, WML (Wireless Markup Language) was defined using XML Data-exchange –Companies have been interchanging electronic data for years –But XML makes it easier –XML enables us to exchange data across HTTP connections, instead of having to use dedicated channels –XML data structures are more flexible than earlier EDI formats -- as well as being computer-readable, they are also human-readable

Defining New Tags In XML, we define our own tags For example, to markup poetry, we might define the following new tags: We could use these to markup the poem we saw earlier, as shown on the next slide

Using XML to mark up a poem The Daffodils William Wordsworth I wandered lonely as a cloud That floats on high o’er vales and hills When all at once I saw a crowd A host of golden daffodils Something something something Something something something else...

We could even mark up the rhymes in a poem We might define a rhyme attribute for the tag Using this, the first verse of the earlier poem might be marked up like this: I wandered lonely as a cloud That floats on high o’er vales and hills When all at once I saw a crowd A host of golden daffodils

Marking up the rhymes in a poem (contd.) Alternatively, we might define a pair of new tags: Using these tags, the first verse of the earlier poem might be marked up like this: I wandered lonely as a cloud owd That floats on high o’er vales and hills ills When all at once I saw a crowd owd A host of golden daffodils ills Remember: we have to use other technology to control rendering, so, regarding the content of rhyme tags, we could decide not to print it in certain renderings or to render it in a special way in other cases

Marking up the rhymes in a poem (contd.) As a third option, we might define the tags but give the tag a sound attribute Using this approach, the verse might be marked up like this: I wandered lonely as a cloud That floats on high o’er vales and hills When all at once I saw a crowd A host of golden daffodils

Marking up the rhymes in a poem (contd.) As a fourth option, we might define the tags for tagging a child element of the tag Using this approach, the verse might be marked up like this: I wandered lonely as a owd cloud That floats on high o’er vales and ills hills When all at once I saw a owd crowd A host of golden ills daffodils

Document Type Definitions and Schemata We have seen several ways of using XML to markup a poem, but we could invent a host of other possible approaches The important point is that, once we have invented a new set of tags and attributes, –XML provides us with a way of documenting the relationship between these tags/attributes so that other people can adopt/understand our approach In fact, XML provides two different ways: –the original way is to write a Document Type Definition (DTD) –a newer way it to write an XML Schema (by the way, and a lot of CS textbook writers don’t seem to know this, the plural of schema is schemata, although schemas is acceptable) If we publish our DTD or our schema, we are, in fact, publishing a new XML-based language that others can use

Cs 4320 got here on 25 feb 2005

Tags in XML XML elements are tagged like HTML elements However, there are some differences XML tags are case sensitive:  the tag is different from the tags and Every start tag must have a corresponding closing tag –a tag like must have a corresponding tag This implies that XML tags must be nested properly Besides starting tags and closing tags, XML allows empty tags (an empty tag is a start tag which does not have a corresponding closing tag) –Empty tags must be written in a special way, with a teminal slash character, as in

Content of XML elements The content of an element is what lies between its start and closing tags Elements can have different types of content The following element has “empty content” The following and elements have “character content” Fred 25

Content of XML elements (contd.) The following element has “element content” 25 Fred The following element has “mixed content” Fred 25

Attributes in XML As in HTML, start tags in XML can have attributes Unlike in HTML, the value of every attribute in XML must be quoted, as we saw in cloud Every attribute must be quoted, even if it a number, as in Fred

Comments in XML Comments in XML are the same as in HTML Thus

XML version declarations The first line of an XML document may declare the version of XML that the document is based on This line uses a special tag and is of the following form where the 1.0 will change when a newer version of XML is used Although an XML version declaration is optional, it will become critical when newer versions of XML are defined, since it will enable programs processing a document to know which syntactic rules to apply

Syntactic acceptability of an XML document XML documents can have different levels of syntactic acceptability –at the lowest level of acceptability, a document is not a proper XML document at all -- it is ill-formed syntactically –at the next level of acceptability, a document obeys the basic rules of XML syntax -- it is well-formed syntactically –at the highest level of acceptability, a document obeys the syntax rules of a special language based on XML -- it is said to be syntactically valid according to the rules for this special XML- based language

Well-formed XML documents To be well-formed an XML document must satisfy the following basic rules of XML syntax: –the document contains exactly one root element –all other elements are descendents of the root element –start and closing tags for an element have the same spelling –the start tag for an empty element has a final / –attribute names are used only once within the same start tag –elements are properly nested – all attribute values must be quoted

Example well-formed XML document The Daffodils William Wordsworth I wandered lonely as a cloud That floats on high o’er vales and hills When all at once I saw a crowd A host of golden daffodils Something something something Something something something else...

Another well-formed XML document Ray Burke 1 Margaret Thatcher 75