
Originally Posted by
Bubbletin
When you say don't use XML-like syntax could you please elaborate for someone with limited html knowledge?
Serving XHTML as HTML on the Web seems to have become quite a popular thing to do, but not for any good reason. There are no advantages for users, and in fact it relies upon poor HTML processing implementations to even work properly (a correct SGML-based HTML processor would choke on this pseudo-XHTML). It's become so ubiquitous that even HTML documents can be found containing XHTML fragments.
The sort of thing that I'm referring to is code such as:
Code:
<img ... />
<meta ... />
<script ... src="..." />
These are legal within XHTML documents (if served as XHTML), but not HTML. The first two are actually equivalent to:
That is, the element followed by a greater-than symbol (>). It's a rare thing to find a user agent that would act this way, but that's no reason to jump on this particularly wobbly wagon.
The last example is more serious though; it's the same as writing
HTML Code:
<script src="..."></script>
in XHTML, but
HTML Code:
<script src="...">>
in HTML. The most important thing to note, though, is that there's no end-tag. Indeed, present this to IE and the document will break rather horridly.
You'll find quite a lot of material on the Web regarding serving XHTML as HTML. The most famous and frequently cited treatise is written by Ian Hickson (also known as Hixie) entitled sending xhtml as text html considered harmful.
Mike
XHTML is an application of XML. That is, XHTML is rooted in the syntactic and semantic rules and conventions of XML.
Bookmarks