1 / 18

XHTML: The New HTML

XHTML: The New HTML. Steven Pemberton Chair, W3C HTML Working Group. Documents. HTML was designed for just one sort of document (scientific reports), but is now being used for all sorts of different documents

shiro
Download Presentation

XHTML: The New HTML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XHTML: The New HTML Steven Pemberton Chair, W3C HTML Working Group

  2. Documents • HTML was designed for just one sort of document (scientific reports), but is now being used for all sorts of different documents • You could use SGML to define other sorts of document, but SGML is notoriously hard to fully implement

  3. Enter XML • XML is a W3C effort to simplify SGML • It is a meta-language, a subset of SGML • One of the aims is to allow everyone to invent their own tags • DTD is optional: a DTD can be inferred from a document

  4. Consequences • The requirement of being able to infer a DTD from a document has an effect on the languages you can define: • Closing tags are now required<LI>....</LI> <P>....</P> • Empty tags are marked specially <IMG SRC=”pic.gif”/> <BR/> <HR/> (or <HR></HR> etc)

  5. Consequences 2 • CDATA sections must be marked as such: <SCRIPT> <![CDATA[ ... script content ... ]]> </SCRIPT>

  6. Consequence of XML • Anyone can now design a (Web-delivered) language • CSS makes it viewable <address> <name>Steven Pemberton</name> <company>CWI</company> <street>Kruislaan 413</street> <postcode>1098 SJ</postcode> <city>Amsterdam</city> <speaker/> </address>

  7. So do we still need HTML? • XML is still a meta-language • There is still a perceived need for a base-line mark-up • HTML has some useful semantics, both implied and explicit (search engines gladly use it, for instance)

  8. HTML as XML application • Clean up (get rid of historical flotsam) • Modularise – split into separate parts • Allows other XML applications to use parts • Allows special purpose devices to use subset • Add any required new functionality (forms)

  9. Differences HTML:XHTML • Because of the difference between SGML and XML, there are some necessary differences, for instance: • Use lower case: <p> not <P> • Attributes are always quoted: <th colspan=”2”> • Anchors use id attribute not name:<a id=”index”>

  10. Example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/strict.dtd"> <html xmlns="http://www.w3.org/TR/xhtml1"> <head><title>Virtual Library</title></head> <body> <p>Moved to <a href="http://vlib.org/">vlib.org</a>. </p> </body> </html>

  11. Namespaces <html xmlns="http://www.w3.org/TR/xhtml1"> <head><title>A Math Example</title></head> <body> <p>The following is MathML markup:</p> <math xmlns="http://www.w3.org/TR/REC-MathML"> <apply><log/><logbase><cn> 3 </cn> </logbase> <ci> x </ci> </apply> </math> </body> </html>

  12. Semantics Differences • Presentation  use CSS • Links  use Xlink and Xpointer (use ID not NAME) • Forms  use CSS? • Images etc.  use Xlink • (Natural) language of elements  use xml:lang attribute

  13. Transition • XHTML 1.0 has been carefully designed to make use of ‘quirks’ in existing HTML browsers • Use of a small number of guidelines allows XHTML to be served to HTML browsers

  14. Examples of Guidelines • Use space before / of empty elements: <br /> <hr /> <img src=“foo.gif” /> • Use name= and id= on <a>: <a name= ”index” id= ”index”> … </a>

  15. Conclusions • XML with related technologies gives you the freedom to define and deliver your own document types • HTML is still needed as a base-line markup • The new HTML gives a transition path to the future

  16. The State of Things • New generation of XML+CSS browsers emerging • Many XML applications appearing • Major companies planning XML as output(Adobe PDF, MS Office 2000) • Now: HTML4 as XML, Conversion software • This year: Modules, Subsets, Extensions, Profiles, New Forms

  17. To Find Out More • All XHTML developments are made public at www.w3.org/Markup • Members of W3C can also look at www.w3.org/Markup/Group

More Related