
Bowerbird@aol.com wrote:
i'm preparing an e-text for submission, and need some info. here's the stuff i've got at the top of my .html file right now.
[html] [head] [title]the title [/title] [/head] [body] [il] [ul]
what do i need, in the form of a doctype and content-type lines, to run it through the validator?
<?xml version="1.0" encoding="us-ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> I would strongly recommend that you get a hold of HTMLTidy (http://tidy.sourceforge.net). Tidy will validate your HTML better than W3C's online validator (which is known to be incorrect in at least one particular), fix the errors that it can (reported as warnings), flag the errors it cannot (reported as errors with line numbers), _and_ add the correct XML header/DTD to the file. If you use the '--output-endoding ascii' option it will guarantee that any non-ASCII character that may have slipped in will be properly converted to a character entity. Note that if your file truly _is_ 100% ASCII you could use "utf-8" or "iso-8859-1", or even "windows-1252" in place of "us-ascii", because for values less than 128 all three of these encoding methods are identical.