This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3574 - Validator don't accept Content-Type:\n application/xhtml+xml
Summary: Validator don't accept Content-Type:\n application/xhtml+xml
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: HEAD
Hardware: All All
: P2 normal
Target Milestone: 0.8.0
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://spacergif.net/2006/08/02/conte...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-02 10:39 UTC by Ih
Modified: 2006-08-05 09:51 UTC (History)
0 users

See Also:


Attachments

Description Ih 2006-08-02 10:39:13 UTC
I played with content-type to see how browsers parse these headers. Unfortunately I found that validator refuse to validate the document with this header mentioned in summary.

My code:

<?php
header("Content-Type:\n application/xhtml+xml");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
.
.
.
</html>

As far as I know HTTP1.1 allow the multi-lined headers.

Quote from http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html 
2.2 Basic Rules

"HTTP/1.1 header field values can be folded onto multiple lines if the continuation line begins with a space or horizontal tab. All linear white space, including folding, has the same semantics as SP. A recipient MAY replace any linear white space with a single SP before interpreting the field value or forwarding the message downstream."

So I suppose my code is good. 

I did some test and I found that Validator accepts the file if I change the \n to \r...

Here are my test results: 

Firefox 1.5	
\r | 13 | CR	HTML
\n | 10 | LF	XML
standard	XML

OPERA 9.0	
\r | 13 | CR	XML
\n | 10 | LF	XML
standard	XML

IE 6.0	
\r | 13 | CR	HTML
\n | 10 | LF	HTML
standard	-

W3 VALIDATOR	
\r | 13 | CR	XML
\n | 10 | LF	refuse
standard	XML

Sorry if I have a mistake... :/