
Originally posted by chrismills:
Thanks dorward - I think I've fixed most of your points with my new description.
Getting better...
If it were up to me, I would add another section at the top about media types, perhaps something along the lines of:
HTML: Servers should deliver HTML to the client with a media type of "text/html".
XHTML: Should use the "application/xhtml+xml" media type but may use "application/xml", "text/xml" or "text/html". If "text/html" is used then the HTML Compatibility Guidelines should be followed because browsers will treat it as HTML (and use error recovery to account for the differences between the languages).
And then I'd change these bits:
Certain elements don’t need a closing tag (ie <p>A paragraph).
How about: "Certain elements don’t need a closing tag (e.g. paragraphs <p>), while others (called "empty elements") forbid the closing tag (e.g. images <img>)."
All elements must be closed—for example <p>A paragraph</p>. Some elements may not contain content and are referred to as “empty elements”. The best way to close these is to write the forward slash after the element’s name, and leave it with just a single tag, for example <hr/>. It can also be done using and opening and closing tag as normal, eg <hr></hr>, but this is not recommended due to the fact that some older browsers that don’t support XHTML very well may misinterpret this, when a proper XHTML doctype is used. It is also recommended that you put a space between the element name and the closing slash, ie <hr />, as it allows older browsers to understand it better.
I'm afraid that seems to be a bit dense (in the "amount of text without breaks" sense).
How about:
All elements must be explicitly closed (e.g. <p>A paragraph</p>). Elements without content may be closed using a slash in the start tag (e.g. <hr></hr> and <hr/> mean the same thing).
If you are serving your XHTML as text/html, then you should use the shorthand syntax on all elements which are defined as being "empty" and place a space before the slash. You should use the long form (with separate start and end tags) on any element which is not defined as empty - even if you don't have any content in it.
Attribute values may or may not be enclosed by quotes.
Some attribute values may be written without being enclosed in quotes.
All attributes must be given a value (ie <option selected="selected">).
The full form must be used for all attributes (e.g. <option selected="selected">)