Transcript An XML Introduction
An Introduction to
XML
:
The e X tensible M arkup L anguage Manitoba Library Associations Conference 2000
Ian Graham, Session T4, 11 May, 2000
An Introduction to
XML
:
The e X tensible M arkup L anguage Ian GRAHAM
Centre for Academic Technology, Information Commons, University of Toronto
Tel:
(416) 978-4548
Email:
Talk:
http://www.utoronto.ca/ian/talks/
Overview
Web history and the birth of HTML HTML is not enough - why ?
XML for universal data Examples of XML in action Profound conclusions ...
The Birth of the Web
The HyperText Markup Language (HTML) A simple language for distributing text-based information Combined with other Web technologies to yield….
A distributed information Web
Four Main Components
URL
: For
addressing
things HTTP: For
transporting
data
CGI
: For adding
functionality
HTML
: For encoding
text information
Databases & other software
HTML
Web Server
CGI
FTP NNTP Shoutcast
URLs HTTP
HTML
A simple, general-purpose language Simple hypermedia ( … Original concept - Collaborative authoring Merging of roles of authoring/viewing )
HTML Evolution
Started with very few tags … simple
requirements
(only need know a little bit about the tags, and then just muddle through) Language
evolved
-- more tags: forms, images, tables, frames, fonts, … driven by functional and marketing demands
HTML Problems (1)
Many wanted
personalized
tags Want to put other data into HTML mathematics, database entries, literary text, poems, purchase orders, graphic layouts ….
Different
conceptions
for the language HTML just isn’t designed for that!
HTML Problems (2)
Software
processing
Server management of data (library Web site, any large site) But -- HTML is so
ill formed
, this is hard!
HTML chunk HTML chunk HTML chunk HTML chunk Web server engine HTML
HTML Problems (3)
Software
processing
Client data processing (machine--machine communication) HTML data (
from somewhere on the Web ...
) But -- HTML is so
ill formed
, this is hard!
Web software
Into a database, or other tool
Idea: Back to Basics
HTML is defined using
SGML
Standard Generalized Markup Language A
meta-language
for defining languages I.e. -- can
define
your own tags Complex, sophisticated, powerful Idea: Use
SGML
Languages based on SGML
HTML TEI DocBook . . . SGML
SGML Problems
Too
complicated
Rules too
strict
Can’t distribute ‘muddle-able’, loosely formatted text (like HTML) Not good in a
distributed
environment Can’t
mix
different data together Can’t add arbitrary tags
Idea (2): “Webified” SGML
New eXtensible Markup Language:
XML
Can use
XML
to define new languages
Distributes
Can
mix
easily on the Web different types of data together can easily add new tags, and tell a browser what to do with them (more or less....)
Basic XML Rules
Tags written as in HTML, but ...
Technical details Tag names are
case-sensitive
Always need
end tags
Special
empty-element
have end tags) tags (that don’t Always
quote
attribute values
Like this example …..
xmlns="http://www.w3.org/TR/xhtml1"
>
Heading of Page
…..And here is another paragraph, this one containing an
/>
inline image, and a
/>
Special XML Things
Says that this is an XML document Says that the meaning of the tags inside (and including) the html element are defined as belonging in the same “space” of names.
xmlns
XML namespace
Evolution of XML
Many XML-defined languages, optimised for different roles
MathML
-- for mathematics
SMIL
RDF
-- for synchronised multimedia -- for describing “things”
XUL
-- for describing the Nav6 user interface
SpeechML
-- for synthesised voices
MathML
Designed to express
layout
of maths Also can express
semantics
Cut & paste into Maple, Mathematica possible support in Navigator 6
x 2 + 4x + 4 =0
SMIL
Synchronised Multimedia Integration Language Integration of multimedia with text, audio, video Support in RealPlayer G2
SMIL Example
XHTML: NextGen HTML
xmlns="http://www.w3.org/TR/xhtml1"
>
Heading of Page
here is a paragraph of text. I will include inside this paragraph a bunch of wonky text so that it looks fancy.
Here is another paragraph with inline emphasized text, and absolutely no sense of humor.
And another paragraph, this one with an
/>
image, and a
/>
line break.
XHTML
Just like HTML, but based on XML rules Will support
integration
into a single document of different data (Doesn’t quite work that way now, unfortunately)
XHTML and other Data
xmlns="http://www.w3.org/TR/xhtml1"
>
Heading of Page
more html stuff goes here
Displaying XML
More complicated than HTML XML represents data only,
not
how it looks Need
extra instructions
(a “style sheet” document) to define how things should look
What Browsers Do Now?
Navigator 4, Internet Explorer 4 Uggh…… (can’t handle XML at all) Internet Explorer 5 -- shows a elements
tree
of Mozilla/Netscape 6 --
ignores
or so it seems (see examples) the tags ...
Other Use:
Data Abstraction
XML as a
universal format
interchange for data Machines exchange data as XML-format messages Eliminates proprietary data formats Lots of XML processing software available
XML Messaging: Business
Factory
Place order
Supplier Supplier Supplier
Response
XML Messaging: Database
Database
Request/send data
Other DB Other DB Other DB
Request/send data
Example Message
Other Examples
XUL: XML User Interface Language How Navigator 5 configures its interface Defines structure and software integration ( www.mozilla.org
) RDF: Resource Description Framework For describing things Used by Netscape define Web accessible resources ( www.dmoz.org
)
Open Catalog
project to
The XML Family Tree
XHTML SMIL SpeechML MathML RDF XUL HTML
TEI
. . . . . .
SGML XML
XML Summary
an
integration
types of data tool for mixing different a
universal format
between machines for exchanging data a
framework
on the Web for distributing information
An Introduction to
XML
:
The e X tensible M arkup L anguage Ian GRAHAM
Centre for Academic Technology, Information Commons, University of Toronto
Tel:
(416) 978-4548
Email:
Talk:
http://www.utoronto.ca/ian/talks/