HTML � XHTML - XML by a40D2c

VIEWS: 14 PAGES: 21

									HTML – XHTML - XML


  How do they differ?
  How are the alike?
XHTML

   Is a combination of HTML and XML –
    combining their strengths we get a markup
    language that is useful now and in the future.
   Consists of all the elements of HTML 4.01
     combined with syntax of XML
   Stricter and cleaner version of HTML
XHTML

   EXtensible HyperText Markup Language
   You should already know HTML and the
    basics of building web pages
   Aimed to replace HTML
   Almost identical to HTML 4.01
   Is W3C Recommendation
   All new browsers support XHTML
Why XHTML?

   There are many pages on WWW that contain
    “bad” HTML.
   There are so many different browser
    technologies today.
   Many browser technologies do have the
    resources to interpret “bad” markup
    language.
HTML + XML = XHTML

   XHTML is useful now and in the future!
   XHTML pages can be read by all XML
    enabled devices.
   XHTML gives you the opportunity to write
    “well-formed” documents NOW!
   XHTML works in all browsers!
   XHTML are backwards browser compatible!
XHTML

 Attribute names must be in lower case
Wrong:
 <table WIDTH=“100%”>
Correct:
 <table width=“100%”>
XHTML

   Attribute Values Must Be Quoted:

Wrong:
 <table width=100%>

Correct:
 <table width=“100%”>
XHTML

 Attribute minimization is forbidden
Wrong:
 <input checked>
 <frame noresize>
Correct:
 <input checked=“checked” />
 <input noresize=“noresize” />
XHTML

 Elements must be properly nested:
Wrong:
<b><i>This text is bold and italic.</b></i>

Correct:
<b><i>This text is bold and italic.</i></b>
XHTML

 Non-empty elements must have an end tag.
  Elements must be closed!
Wrong:
<p>this is a paragraph
<p>This is a paragraph
Correct:
<p>This is a paragraph</p>
<p>This is a paragraph</p>
XHTML

   Empty elements must also be closed. Empty
    elements must either have an end tag or the start
    tag must end with />.
Wrong:
A break: <br>
A horizontal rule: <hr>
An image:<img src=“happy.gif” alt=Happy face”>
Correct:
A break: <br />
A horizontal rule: <hr />
An image:<img src=“happy.gif” alt=Happy face” />
XHTML

   Tag name and elements must be in lower
    case.
Wrong:
<BODY>
<P>This is a paragraph</P>
</BODY>
Correct:
<body>
<p>This is a paragraph</p>
</body>
XML

   Is a language for creating other languages.
   You can use XML to design your own custom
    markup language…

   Additional information can be found 7th edition by
    Elizabeth Castro.
XML

   Designed to be self-descriptive
   Designed to carry data.
   A markup language where everything has to
    be marked up correctly resulting in “well-
    formed” documents.
   Designed to describe data (where as HTML
    was designed to display data.)
XML

<note>
<to>Tom</to>
<from>Jan</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

An XML document does not DO anything. It is just pure
information wrapped in tags. Someone must write a piece
of software to send, receive or display it.
XML

   You invent your own tags.
   The tags in the example above (like <to> and <from>)
    are not defined in any XML standard. These tags are
    "invented" by the author of the XML document.
   That is because the XML language has no predefined
    tags.
   The tags used in HTML (and the structure of HTML) are
    predefined. HTML documents can only use tags defined
    in the HTML standard (like <p>, <h1>, etc.).
   XML allows the author to define his own tags and his
    own document structure.
XML

   Today’s market consists of different browser
    technologies, some browsers run Internet on
    computers, and some browsers run Internet on
    mobile phones and hand helds.
   Those browsers which run Internet on mobile
    phones and hand helds do not have the resources
    or power to interpret a “bad” markup language.
Difference between XML & HTML

   XML is not a replacement for HTML
   Each was designed for different goals
   HTML was designed to display data, how it
    looks, basically displaying information.
   XML designed to carry data, focusing on
    what data is basically carrying information
Remember….

   XHTML is not very different from HTML 4.01
    standard.
   Making sure you write code up to HTML 4.01
    standard is necessary.
   You can prepare yourself for XHTML by starting
    to write strict HTML.
   As always you can check on the W3C website
    for more information.
   More information found on pages 21-22in the text HTML, XHTML &
    CSS by Elizabeth Castro
HTML5

   Began outside of the W3C with a group of
    people associated with the development of
    Mozilla and WebKit browsers technologies.
   In 2007 it came under W3C direction.
   HTML5 is the future of HTML.
   Still a work in progress but learning
    HTML4.01 and CSS will make learning HTML5
    easy.
HTML5….. What would be new…

There are a few exciting new elements in HTML 5:

<canvas> - an element to give you a drawing space in JavaScript on
  your Web pages. It can let you add images or graphs to tool tips or
  just create dyanmic graphs on your Web pages, built on the fly.

<video> - add video to your Web pages with this simple tag.

<audio> - add sound to your Web pages with this simple tag.

								
To top