[thelist] ?xml &c. declaration

Austin Govella austin at desiremedia.com
Wed Jun 19 15:21:00 CDT 2002


>> Can anyone on thelist give me a good reason for using the xml
>> declaration,
> (ie
>> <?xml version="1.0" encoding="iso-8859-1" ?>) in a page?

Good reason not to use it: older browsers don't understand it, so they
print it out at the top of your page. You can substitute a meta tag with
the declaration in it:

<!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" xml:lang="en" lang="en">

<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I'm specifying UTF-8, but I'd never heard valid UTF-8 would allow you to
dispense with the declaration entirely. You can specify different
character sets if you choose (ISO-BLAH-BLAH, UTF-16).

--
Austin




More information about the thelist mailing list