Reply
XML declaration in XHTML
Old 06-29-2007, 01:20 PM XML declaration in XHTML
JTLauder's Avatar
Novice Talker

Posts: 5
Do you put an XML declaration at the top of an XHTML file?
XML specifications require an XML declaration, but I don't usually see it on XHTML files, and my tests show not all browsers know what to do with it.
What's the standard practice regarding this?
JTLauder is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 06-29-2007, 03:13 PM Re: XML declaration in XHTML
LadynRed's Avatar
Super Moderator

Posts: 6,562
Location: Tennessee
Quote:
Do you put an XML declaration at the top of an XHTML file?
No, I don't. I know, the purists scoff at serving XHTML as text, but that's on on-going argument.

The XML declaration will throw IE 6 and below into Quirks mode, so you don't want it in there at all. If you're using PHP, you can do some browser sniffing and only serve the page with the XML declaration to Standards-compliant browsers.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to XML declaration in XHTML
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11251 seconds with 12 queries