Understanding HTML, XML, and XHTML: Evolution of Markup Languages
This article explores the development of HTML, XML, and XHTML, highlighting their roles in web documentation and data interchange. HTML originated in 1992, evolving through versions up to HTML 4.01, which introduced multimedia support and improved accessibility. XML, a flexible markup language, allows for structured data sharing, while XHTML is a stricter reformulation of HTML in XML syntax. Learn about essential rules for XHTML and see examples of XML data structure, illustrating the importance of markup languages in modern web development.
Understanding HTML, XML, and XHTML: Evolution of Markup Languages
E N D
Presentation Transcript
HTML & XHTML Introduction
First HTML • 1992 • Marked-up text to represent a hypertext document for transmission over the network • The hypertext mark-up language is an SGML format • The 1st web page was created
Versions of HTML - HTML 2.0 • 1996 • Can represent hypertext news, mail, documentation, and hypermedia; • Menus of options; • Database query results; • Simple structured documents with in-lined graphics
HTML 3.2 • Tables, applets, text-flow around images, superscripts and subscripts • Provided backwards compatibility with the existing HTML 2.0 Standard.
HTML 4.0 & 4.01 • Supports more • Multimedia options • Scripting languages • Style sheets • Better printing facilities • Accessible to users with disabilities • Internationalization of documents • Last of HTML
XML • eXtensible Markup Language • Developed by the W3C • A subset of SGML constituting a particular text markup language for interchange of structured data • A flexible way to create standard information structure • Share data & structure over the Web
Example • XML file • CSS file • More at http://www.xml.com/
Sample XML <Video> <Movie> <Year>1996</Year> <Title>Mission: Impossible</Title> <Director>Brian De Palma</Director> <Type>Action</Type> <Actor_Male>Tom Cruise</Actor_Male> <Actor_Female>Emmanuelle Beart</Actor_Female> <Time>110</Time> <Rating>PG-13</Rating> </Movie> <Movie> <Year>2004</Year> <Title>Home on the Range</Title> <Director>Will Finn</Director> <Type>Comedy</Type> <Actor_Male>G.W. Bailey</Actor_Male> <Actor_Female>Roseanne</Actor_Female> <Time>76</Time> <Rating>PG</Rating> </Movie> </Video> <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/css" href="bellvideo-css.css"?> <!-- File Name: bellvideo.xml --> <!DOCTYPE Video [ <!ELEMENT Video (Movie+)> <!ELEMENT Movie (Year, Title, Director, Type, Actor_Male, Actor_Female, Time, Rating)> <!ELEMENT Year (#PCDATA)> <!ELEMENT Title (#PCDATA)> <!ELEMENT Director (#PCDATA)> <!ELEMENT Type (#PCDATA)> <!ELEMENT Actor_Male (#PCDATA)> <!ELEMENT Actor_Female (#PCDATA)> <!ELEMENT Time (#PCDATA)> <!ELEMENT Rating (#PCDATA)> ] >
HTML + XML XHTML • Extensible Hypertext Markup Language • Application of XML • Successor to HTML • Reformulation of HTML 4.0 in XML 1.0 • Stricter remaking of HTML • Deprecated tags – phasing out some tags from HTML 4.01
Rules of XHTML • Use all lowercase letters for tags • Nest elements correctly • <b><i>This is wrong.</b></i> • <b><i>This is right.</i></b>. • Always use end tags • End empty elements • <br> <br /> <hr> <hr /> • Error in page 57 in the textbook
Rules of XHTML (cont.) • Use quotation marks for values • <h1 align=center> <h1 align=“center“> • Give every attribute a value • <hr noshade /> <hr noshade=“noshade” /> • Use code for special characters • <img alt="Me & My Son"> <img alt="Me & My Son">.
Rules of XHTML (cont.) • Use id insead of name • < a name=“toc”> <a id=“toc”> • Put styles and scripts in separate file • Declare DOCTYPE Resource: http://personalweb.about.com/od/basichtml/a/409xhtml.htm
Template <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>TITLE OF PAGE GOES HERE</title> </head> <body> CONTENT OF PAGE GOES HERE. </body> </html>