XML HTML and All That What do they

  • Slides: 42
Download presentation
XML, HTML and All That What do they Mean, and Why are they Important?

XML, HTML and All That What do they Mean, and Why are they Important? Ian GRAHAM Centre for Academic Technology Tel: 978 -4548 Email: <ian. graham@utoronto. ca> Talk: http: //www. utoronto. ca/ian/talks/

Overview z. The birth of HTML z. Why HTML was not enough z. XML

Overview z. The birth of HTML z. Why HTML was not enough z. XML for data encoding z. Examples of XML z. Some thoughts for the future

HTML z. Simple, general-purpose markup language z. Simple hypermedia z. Original idea -y. Support

HTML z. Simple, general-purpose markup language z. Simple hypermedia z. Original idea -y. Support collaborative authoring y. Merge document authoring/viewing

HTML Evolution z. Started with very few tags … z. Simple requirements yonly need

HTML Evolution z. Started with very few tags … z. Simple requirements yonly need to know a little bit about the tags, and then just “muddle through”) z. Evolved to have more tags were added yforms, images, tables yframes, fonts, applets, embeds. .

Outline z. The birth of HTML z. Why HTML was not enough z. XML

Outline z. The birth of HTML z. Why HTML was not enough z. XML for data encoding z. Examples of XML z. Some thoughts for the future

HTML Problems (1/3) z. People wanted additional tags yformatting other types of data z.

HTML Problems (1/3) z. People wanted additional tags yformatting other types of data z. Desire for other types of data ymathematics, database entries, literary text, ‘messages’ (e. g. , a purchase order) …. z. Difficult/impossible with HTML y. Can’t arbitrarily extend the language

HTML Problems (2/3) z Software processing y. Server management of data Web server engine

HTML Problems (2/3) z Software processing y. Server management of data Web server engine HTML z But -- HTML is so illformed, this is hard! HTML

HTML Problems (3/3) z Software processing y. Client data processing (machine -- machine communication)

HTML Problems (3/3) z Software processing y. Client data processing (machine -- machine communication) z Again, hard because - HTML is generally so ill-formed. HTML Data processor (from somewhere on the Web. . . ) Database, viewer, whatever. .

Three New “Patterns” z. Distribution of stuff to read or see (like HTML, but

Three New “Patterns” z. Distribution of stuff to read or see (like HTML, but more so) z. Modeling data inside a Web application (like a text database) z. Structure of data messages sent between machines. . HTML is ok, at best, for the first. .

Outline z. The birth of HTML z. Why HTML was not enough z. XML

Outline z. The birth of HTML z. Why HTML was not enough z. XML for data encoding z. Examples of XML z. Some thoughts for the future

First Idea: Back to Basics z. Since HTML is defined using SGML. . .

First Idea: Back to Basics z. Since HTML is defined using SGML. . . y. Standard Generalized Markup Language y. A meta-language for defining languages y. Complex, sophisticated, powerful z. . . Use SGML instead

Didn’t fly because. . . z. SGML too complicated z. SGML rules too strict

Didn’t fly because. . . z. SGML too complicated z. SGML rules too strict y. No ‘loosely’ formatted data (like HTML) y. Not good in a distributed environment y. Can’t mix different data together x. Can’t add arbitrary tags

Idea 2 -- XML: The e. Xtensible Markup Language z. A simpler language based

Idea 2 -- XML: The e. Xtensible Markup Language z. A simpler language based on SGML z. Can use XML to define new languages z. Distributes easily on the Web z. Can mix different types of data together ycan easily add new tags, and tell a browser what to do with them (more or less. . )

Basic XML Tag Syntax: z. Tags written as with HTML, but. . . z.

Basic XML Tag Syntax: z. Tags written as with HTML, but. . . z. Technical details <tag>. . </Tag> y. Case-sensitive names y. Always need end tags <line. Break /> y. Special empty-element y. Always quote attribute values <tag id=“ 23”>

XML Example: <? xml version="1. 0" encoding="iso-8859 -1"? > <html xmlns="http: //www. w 3.

XML Example: <? xml version="1. 0" encoding="iso-8859 -1"? > <html xmlns="http: //www. w 3. org/TR/xhtml 1" > <head> <title> Title of text XHTML Document </title> </head><body> <div class="my. Div"> <h 1> Heading of Page </h 1> …. . <p>And here is another paragraph, this one containing an <img src="image. gif" alt="waste of time" /> inline image, and a line break. </p> </div> </body></html> XML stuff

Special XML Things z <? xml version=“ 1. 0” encoding=“iso-8859 -1” ? > y.

Special XML Things z <? xml version=“ 1. 0” encoding=“iso-8859 -1” ? > y. Says that this is an XML document z <html xmlns=“http: //www. w 3. org/TR/xhtml 1”> y. Says that the meaning of the tags inside (and including) the html element belong in the same “space” of names. xmlns XML namespace

Outline z. Web history and the birth of HTML z. Why HTML was not

Outline z. Web history and the birth of HTML z. Why HTML was not enough z. XML model for data encoding z. Examples of XML z. Some thoughts for the future

Evolution of XML z. Many XML languages for different roles y. Math. ML --

Evolution of XML z. Many XML languages for different roles y. Math. ML -- for mathematics y. SMIL -- for synchronised multimedia y. XHTML -- XML-ized HTML y. RDF -- for describing “things” y. HEML -- Historical events, y. . and many others.

Math. ML: Mathematics z Designed to express layout of maths z Also can express

Math. ML: Mathematics z Designed to express layout of maths z Also can express semantics z Cut & paste into Maple, Mathematica z x 2 + 4 x + 4 =0 <mathml xmlns=“http: //www. w 3. org/TR/mathml”> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mrow> <mn>4</mn> <mo>&invisibletimes; </mo> <mi>x</mi> </mrow> <mo>+</mo> <mn>4</mn> </mrow> <mo>=</mo> <mn>0</mn> </mrow>. . .

XHTML: Next. Gen HTML <? xml version="1. 0" encoding="iso-8859 -1"? > <html xmlns="http: //www.

XHTML: Next. Gen HTML <? xml version="1. 0" encoding="iso-8859 -1"? > <html xmlns="http: //www. w 3. org/TR/xhtml 1" > <head> <title> Title of text XHTML Document </title> </head> <body> <div class="my. Div"> <h 1> Heading of Page </h 1> <p> here is a paragraph of text. I will include inside this paragraph a bunch of wonky text so that it looks fancy. </p> <p>Here is another paragraph with <em>inline emphasized</em> text, and <b> absolutely no</b> sense of humor. </p> <p>And another paragraph, this one with an <img src="image. gif" alt="waste of time" /> image, and a line break. </p> </div> </body></html>

XHTML z. Just like HTML, but with XML syntax z. XML model, however, supports

XHTML z. Just like HTML, but with XML syntax z. XML model, however, supports integration of different data / languages inside a single XML document:

XHTML and other data <? xml version="1. 0" encoding="iso-8859 -1"? > <html xmlns="http: //www.

XHTML and other data <? xml version="1. 0" encoding="iso-8859 -1"? > <html xmlns="http: //www. w 3. org/TR/xhtml 1" > <head> <title> Title of XHTML Document </title> </head><body> <div class="my. Div"> <h 1> Heading of Page </h 1> <mathml xmlns=“http: //www. w 3. org/TR/mathml”> … Math. ML markup … </mathml> <p> more html stuff goes here </p> <smil xmlns=“http: //www. w 3. org/TR/smil 1”> … SMIL markup … </smil> </div> </body></html>

Displaying XML z. More complicated than HTML y. XML only represents a data structure,

Displaying XML z. More complicated than HTML y. XML only represents a data structure, not how it looks y. Need extra instructions (a “style sheet” document) to define how things should look y. See example pages on associated Web site.

Data input HTML Processor Default rules for HTML markup and formatting + CSS style

Data input HTML Processor Default rules for HTML markup and formatting + CSS style sheet(s) XML No default markup/ formatting rules CSS and/or XSL style sheet(s) + Rendered / displayed content XML Processor Namespacedeclared processors and rules +

Other Use: Data Abstraction z. XML as a format for data interchange y. Machines

Other Use: Data Abstraction z. XML as a format for data interchange y. Machines exchange data as XML messages y. Eliminates proprietary base-level syntax y. Lots of XML processing software available

Resource/Rich Site Summary RSS -z. Tool for distributing news headlines z. Used by many

Resource/Rich Site Summary RSS -z. Tool for distributing news headlines z. Used by many news services, including: y. Netscape Webcenter y. Meerkat (http: //www. oreillynet. com/meerkat/) y. Slashdot (http: //www. slashdot. org) y. Moreover (http: //www. moreover. com)

RSS Example <rss version="0. 91"> <channel> <title>Actualités Netscape</title> <link>http: //home. netscape. com/fr/netscape</link> <description>Actualité Netscape

RSS Example <rss version="0. 91"> <channel> <title>Actualités Netscape</title> <link>http: //home. netscape. com/fr/netscape</link> <description>Actualité Netscape - À la une</description> <language>fr</language> <image> <title>Netscape Netcenter</title> <link>http: //home. netscape. com/fr</link> <url>http: //home. netscape. com/images/nnc_lockup. gif</url> <width>123</width> <height>33</height> </image> . . . .

Generic XML Messages: Factory/DB Place order request/send data Supplier/DB Response

Generic XML Messages: Factory/DB Place order request/send data Supplier/DB Response

Outline z. The birth of HTML z. Why HTML was not enough z. XML

Outline z. The birth of HTML z. Why HTML was not enough z. XML for data encoding z. Examples of XML z. Some thoughts for the future

Future Trends z. XML for modeling information about things, or resources z. Distributed models

Future Trends z. XML for modeling information about things, or resources z. Distributed models for managing, linking, and sharing XML information z“Cooperative information Webs” also called. . “The Semantic Web”

Example: HEML z. Historical Event Markup and Linking y. A standard, flexible and extensible

Example: HEML z. Historical Event Markup and Linking y. A standard, flexible and extensible means of encoding an historical event or series of events in electronic form z. Lets you create Webs of historical data, cross-related using HEML markup.

Example HEML Record <event id="Att 1915"> <label xml: lang="en">Attack on Gallipoli</label> <date calendar="Gregorian" era="AD"

Example HEML Record <event id="Att 1915"> <label xml: lang="en">Attack on Gallipoli</label> <date calendar="Gregorian" era="AD" xml: lang="en"> <year>1915</year> <month>08</month> <day>9</day> </date> <location>Gallipoli Peninsula</location> <origin xml: link="http: //www. lib. byu. edu/~rdh/wwi/1915/gallpoli. html” /> </event>

Example: Data Syndication z. A generic mechanism for exchanging “chunks” of information z. Lets

Example: Data Syndication z. A generic mechanism for exchanging “chunks” of information z. Lets sites / databases / research projects exchange many different types of data z. Can contain HEML, RSS, and other data in the same message zhttp: //www. java. utoronto. ca/news/

Syndication Example <syndication. Message> <metadata> info about the aggregator </metadata> <item> <metadata> metadata about

Syndication Example <syndication. Message> <metadata> info about the aggregator </metadata> <item> <metadata> metadata about the item </metadata> <data> the data itself -- this could be HEML, RSS, or whatever -</data> </item> <item>. . . additional items in the message. . . </item>. . . </syndication. Message>

Example Application: Request new HEML stuff, plus popular news (RSS) and seminar listings (XSe.

Example Application: Request new HEML stuff, plus popular news (RSS) and seminar listings (XSe. L) <syndication. Message> containing HTML, RSS, and other data chunks

XML Summary zan integration tool for mixing different types of data za universal format

XML Summary zan integration tool for mixing different types of data za universal format for exchanging data between machines za framework for distributing information on the Web

XML, HTML and. . . Ian GRAHAM Centre for Academic Technology Tel: 978 -4548

XML, HTML and. . . Ian GRAHAM Centre for Academic Technology Tel: 978 -4548 Email: <ian. graham@utoronto. ca> Talk: http: //www. utoronto. ca/ian/talks/

Web history: 4 components: HTTP, URLs, CGI and HTML Web server Databases; other software

Web history: 4 components: HTTP, URLs, CGI and HTML Web server Databases; other software HTML CGI HTTP URLs

Open Directory Data z. RDF: Resource Description Framework y. A language for describing things

Open Directory Data z. RDF: Resource Description Framework y. A language for describing things y. Used by Netscape Open Catalog project to define Web accessible resources (http: //dmoz. org) y. RDF describes the catalog structure, and also the items entered into the catalog

The XML Family Tree SMIL XHTML Speech. ML XUL Math. ML RDF TEI .

The XML Family Tree SMIL XHTML Speech. ML XUL Math. ML RDF TEI . . . XML SGML