View Single Post
11-12-2008, 09:34 AM
#18
Normo is offline Normo
Normo's Avatar
Status: Member
Join date: Aug 2008
Location: Hampshire, UK
Expertise:
Software:
 
Posts: 202
iTrader: 1 / 100%
 

Normo is on a distinguished road

  Old

Originally Posted by rochow View Post
Nice plug



Not 1 thing you said is correct.

More reliable? False.
Stricter? False.
Better written? False.

XHTML is more reliable? Oh really, so my HTML is just going to one day just magically stop working while XHTML continues to keep working? Hardly.

Stricter syntax? No, different, not stricter.

Badly written markup? So if it's XHTML it's written well, and if it's HTML its therefore written bad? Please.

But hey, someones gotta live in fairyland.
I'll let good old W3C say what I am trying to
Originally Posted by W3C
Why is XHTML needed? Isn't HTML good enough?
HTML is probably the most successful document markup language in the world. But when XML was introduced, a two-day workshop was organised to discuss whether a new version of HTML in XML was needed. The opinion at the workshop was a clear 'Yes': with an XML-based HTML other XML languages could include bits of XHTML, and XHTML documents could include bits of other markup languages. We could also take advantage of the redesign to clean up some of the more untidy parts of HTML, and add some new needed functionality, like better forms.

What are the advantages of using XHTML rather than HTML?
If your document is just pure XHTML 1.0 (not including other markup languages) then you will not yet notice much difference. However as more and more XML tools become available, such as XSLT for tranforming documents, you will start noticing the advantages of using XHTML. XForms for instance will allow you to edit XHTML documents (or any other sort of XML document) in simple controllable ways. Semantic Web applications will be able to take advantage of XHTML documents.

If your document is more than XHTML 1.0, for instance including MathML, SMIL, or SVG, then the advantages are immediate: you can't do that sort of thing with HTML.

Can I just put the XML declaration on top of existing HTML documents? Can I intermix HTML 4.01 and XHTML documents?
No. HTML is not in XML format. You have to make the changes necessary to make the document proper XML before you can get it accepted as XML.


Why are browsers so fussy about XML? They were more accepting with HTML.
This is deliberate. HTML browsers accept any input, correct or incorrect, and try to make something sensible of it. This error-correction makes browsers very hard to write, especially if all browsers are expected to do the same thing. It has also meant that huge numbers of HTML documents are incorrect, because since they display OK in the browser, the author isn't aware of the errors. This makes it incredibly difficult to write new web user agents since documents claiming to be HTML are often so poor.

Why should I care if my document is in correct HTML? It displays all right on my browser.
All browsers know how to deal with correct HTML. However, if it is incorrect, the browser has to repair the document, and since not all browsers repair documents in the same way, this introduces differences, so that your document may look and work differently on different browsers. Since there are hundreds of different browsers, and more coming all the time (not only on PCs, but also on PDAs, mobile phones, televisions, printers, even refrigerators), it is impossible to test your document on every browser. If you use incorrect HTML and your document doesn't work on a particular browser, it is your fault; if you use correct HTML and it doesn't work, it is a bug in the browser.
Source