|
Posted by David Dorward on 03/20/06 01:43
xyZed wrote:
> If I was starting from scratch and I knew what I know now I would
> probably have used just HTML, but I really don't have time to go over
> all my markup and get rid of all the XHTML stuff.
If it's XHTML then it should be relatively trivial to convert it to HTML -
with an automated process. If your XHTML conforms to Appendix C then all
you should have to do is:
* Strip the xmlns attribute from the <html> element
* Strip the xml:lang attribute from same
* Replace every instance of " />" with ">" (Assuming you never use " />" as
character data - something that isn't all that likely).
* Change the doctype.
A simple multiple file search and replace will so the job.
If you haven't conformed to Appendix C then the specs forbid serving as
text/html anyway - and XSLT can convert to HTML 4.01 without too much pain.
> When embarking on web design I read books which convinced me to use
> XHTML. Would it be acceptable to use the Strict XHTML 1.1 DTD?
There is no such thing.
XHTML 1.1 does not have the clause which allows it to be served as
text/html, so you can pretty much forget about serving it to GoogleBot or
Internet Explorer.
XHTML 1.0 Strict has such a clause, providing you follow the guidelines in
Appendix C. These guidelines depend on bugs in browser support for HTML so
are silly at best. (And those guidelines include, to paraphrase, "Don't do
anything you can't do in HTML anyway).
> Is there an accepted problem with XHTML strict, or is it just a
> preference by some to stick with HTML.4.1 because they see little
> tangible benefit with XHTML?
Again, no such thing as HTML 4.1. I expect you mean HTML 4.01.
The /only/ advantage of serving XHTML to HTML 4.01 clients is that you can
write XHTML and not have any work to do converting it to something sane
before serving it to clients.
If you serve XHTML as XHTML to Mozilla based clients (such as Firefox) then
you lose a some feature (including support for document.write() and
incremental rendering).
Some clients (rare, but not non-existent) don't have the bugs that Appendix
C depends on, so they will display ">" characters in the rendered page when
you have an element using XML style self-closing tag syntax.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Navigation:
[Reply to this message]
|