Why You Should Use XHTML
Da_Slayer writes "The w3's HTML group has released the 6th public working draft for XHTML 2.0. XHTML 2 is a general-purpose markup language designed for representing documents for a wide range of purposes across the Web. Meaning it is to be used for document structuring which is why it does not have presentation elements. The draft is located at w3's website. Also they have a FAQ about why you should use XHTML over HTML. It goes into specifics about embedding MathML, SVG, etc... and has links to tools and resources to help convert existing html documents to xhtml. One of those resources is a document on XML events and its advantages over the onclick style of event handling."
Which browsers accept the media type application/xhtml+xml? Browsers known to us include all Mozilla-based browsers, such as Mozilla, Netscape 5 and higher, Galeon and Firefox, as well as Opera, Amaya, Camino, Chimera, DocZilla, iCab, Safari, and all browsers on mobile phones that accept WAP2. In fact, any modern browser. Most accept XHTML documents as application/xml as well. See the XHTML Media-type test for details. Does Microsoft Internet Explorer accept the media type application/xhtml+xml? No.
M$ Lawyer: But `gcc
XHTML 2.0 almost forces you to seperate "content" from "presentation". Which is a good thing.
Something better would be to use pure XML for creating content and then let the browser apply a CSS to present the content.
See Mozilla + CSS + XML = Structured + Formatted Content for more info.
Consensus is good, but informed dictatorship is better
XML is a metalanguage; that is, it's a mark-up language for writing other mark-up languages. XHTML is one such language. It's basically plain old HTML but with XML's stricter rules. I like it because it discourages sloppy coding (sort of like preferring Java over Perl).
Other XML languages include SVG (for vector graphics), WML (for simple web pages designed for cell phones; never really took off), and RSS (for news feeds).
While HTML is an implementation of SGML (Standard Generalized Markup Language), XHTML is an implementation of XML (Extensible Markup Language, which is a subset of SGML used for describing different types data).
Basically as long as HTML follows the syntax structure of SGML correctly it is considered valid, but XHTML must follow the rules of XML correctly in order to be valid.
XML is a pretty generic set of format rules. There are LOTS of various formats that are implemented in XML (SVG, XHTML, XSLT for some popular examples).
:)).
XHTML applies the rules of XML to HTML. For instance you can have one root node, you have to close all tags, attributes have to have single or double quotes around their values, etc.
Writing something that parses XHTML is a LOT simpler than writing something that parses HTML. It's also easier to confirm you've written it properly (using schemas for instance, which are also written in XML
Get your own free personal location tracker
Nope, you're right.
I'll go out on a limb and say that using XML as the document format for web site production is a terrible idea. XML is a great data exchange language between systems, but it's insanely inefficient for use within a single system. All of XML's positive attributes (self documenting, robust, extensible, supports encodings, validation, use XSLT to do transforms between arbitrary XML representations of data, etc.) are all important between loosely coupled systems. But those issues don't occur within a single system, and the overhead of using XML is immense. It's orders of magnitude faster to query a datbase directly than to parse XML, transform, etc.
Enable 3D printed prosthetics!
You weren't kidding when you said "a lot" ... damn!
/. with XHTML and CSS. Bottom line:
For those who didn't RTFA the parent post had, it restructures
* Savings per day without caching the CSS files: ~3.15 GB bandwidth
* Savings per day with caching the CSS files: ~14 GB bandwidth
And the traffic figure they used was from June 2000. Do the math.
Who doesn't like free music?
Rob mentionned in his journal not too long ago that he had redesigned his page using HTML+CSS and that he would like to someday do the same for Slashdot.
Karma: Could be worse (could be raining)
I don't know about you guys, but my pages are already written in XHTML 1.0 and, thanks to CGI.pm, all I need to get my pages up to the XHTML 2.0 spec is a newer version of CGI.pm which would be provided through a newer Perl distribution.
Ah portability..
- Readability: XHTML is readable as long as it is structured correctly. Note: That doesn't mean having everything on one line.
- XHTML can be done with a plain text editor just like regular HTML, though as always, it's best to use a text editor that at least has syntax highlighting.
I code valid XHTML nearly everday as a freakin' hobby. There's 3 useful things I've come to know:- Make it structured and it is easily readable. Tabs, line breaks, and spaces in appropriate places.
- A text editor with syntax highlighting. A must.
- Ok, so I forgot what the third was.
The above is true for nearly all programming. Slashdot, home of the all-knowing arrogant beings.Its been done http://www.alistapart.com/articles/slashdot/ Its happening now http://www.slashcode.com/plugins/04/03/04/0229237. shtml?tid=4&tid=24&tid=28
Big update in next few months in the cvs
http://www.slashcode.com/
Yes its not here now, but it sounds like slashdot will be XHTML compliant soon.
If you dont like it, fix it, public CVS. Dont bitch, change it your self.
TruePunk | Games
Good descriptions so far, lemme add my two cents. A professor I had put it this way, "XML is more like a set of rules than a language; XHTML, SVG, etc are languages built using those rules."
I always thought it was a good way to think of the relationship.
How do you know that? Did you actually write both an HTML and an XHTML parser?
I'll tell you why it's easier to parse XHTML than HTML: if you're sure you've got well-formed XHTML data, then ALL you need to "parse" XHTML (that is, get it in a document tree format) is an XML parser, which someone else has conveniently written. Compare this with parsing HTML, which requires hacks to compensate for HTML's looser rules (i.e., elements like <p> and <br> which don't need to be closed off, etc.).
Now rendering XHTML is another story altogether, but there is no doubt that parsing XHTML is FAR easier than parsing HTML.
The id and name attributes aren't meant to be the same. The name attribute is used for naming form controls, and (for example) this means that all radio buttons that are meant to be part of the same set all have the same name. Since the id attribute is meant to contain a unique identifier, making them the same would mean either [a] making it impossible to group radio buttons, since their names would need to be unique, or [b] making it impossible to grab an element by it's unique identifier, since ids can't be unique if you want to group radio buttons. Which would you prefer, exactly?