Forum Moderators: open
cheers.
steve.
HTML is derived from an older and much more complex formatting language known as SGML. But HTML can also be expressed using XML, instead of SGML rules, in which case it is known as XHTML.
XHTML 1.0 documents are not necessarily lighter than HTML 4.01 documents. But in the former, CSS is to be used for all visual formatting and XHTML only to describe a document's contents. CSS is much more powerful than HTML tags for formatting data, and although it is not necessarily more efficient, it can be externalized and therefore easily cached as well as replaced. Removing formatting elements from the document can also makes it cleaner, since tags are used not to change the visual display of text or objects, but to describe what purpose they serve in the document.
So to address your question, simply re-expressing your HTML as XML will not make them smaller or more efficient. That will come from analyzing the document, replacing formatting tags with CSS, and structuring it efficiently and semantically.
Check out [xml.com...] for more detailed information about the purpose and features of XML and how it relates to HTML.
XML is not a replacement for HTML and never will be. XHTML is the future HTML replacement, but XHTML is not XML either.
XHTML can also be valid XML. Hence you can give it an XML declaration. (It is "well formed".)
As for the future of HTML, who knows? I'd perhaps like to see it one day become XML only. Aren't the W3C giving us XHTML now as an inbetween step? (An XML format that can be passed successfully to HTML browsers that can't handle XML, but can also be served as "application xhtml/xml" to browsers capable of parsing it (as XML). (IE6 can't handle this, but Opera and Mozilla can, for instance. They actually throw an error and stop dead if the XML is not well-formed.))
I'd say never predict where the web is going. Microsoft might yet change it all when Longhorn and XAML may force us down a whole new route that leaves HTML behind. Then again, for the sake of old pages, we may never be freed from HTML.
IE6 can't handle this
IE6 can in fact handle this if you coax it gently.
You need to create your xml and serve it up as "application/xml"
Then ,you need to save the following XSLT as xhtml.xsl
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<template match="/">
<copy-of select="."/>
</template>
</stylesheet>
Then include the following after your <?xml> declaration:
<?xml-stylesheet type="text/xsl" href="xhtml.xsl"?>
Bingo! OK, it's a bit of a fudge, but it's better than serving XHTML documents as "text/html" in my opinion.