Re: carriage return or line feed in URI attribute values?

Bjoern Hoehrmann wrote:

>* Jim Correia wrote:
>  
>
>>What does the specification have to say about
>>
>><a href="http://www.example.com/
>>index.html">Example</a>
>>
>>Notice the line break in the middle of the attribute value.
>>    
>>
>White-space is disallowed in URIs, thus the document is invalid. HTML
>4.01 does not specify how (nor if) user agents must recover from this
>error.
>
More specifically, any series of white space between the first 
non-whitespace character and the last non-whitespace character are 
supposed to become a single space when parsed (according to XML rules 
and probably SGML as well).  However, as Bjoern said, any whitespace is 
invalid in a URL so your HTML is not invalid, your URL is invalid.  If 
there needs to be whitespace somewhere, put it at the beginning or end 
of the attribute because is is supposed to be stripped when parsed and 
will make no difference if parsed properly.

-- 
Brant Langer Gurganus
http://www.cherokeescouting.org/OtherUnits/Troop545IIN/brant.xhtml

If "Actions speak louder than words," how is that "The pen is mightier than the sword."?

Received on Sunday, 2 March 2003 00:50:16 UTC