W3C home > Mailing lists > Public > www-validator@w3.org > September 2001

Re: Leading spaces inside of a tag?

From: Joseph Pingenot <jap3003@ksu.edu>
Date: Mon, 10 Sep 2001 14:59:18 -0500
To: Masayasu Ishikawa <mimasa@w3.org>
Cc: www-validator@w3.org
Message-ID: <20010910145917.A28016@ksu.edu>

Ah.  Thanks for the information.  It might be nice, though, even if it
  *is* valid, for the HTML validator to throw out a warning with the
  information you gave me.  :)
Nice illustration of one of the difference between SGML and XML, too.
Thanks again!

                              -Joseph

From Masayasu Ishikawa on Monday, 10 September, 2001:
>It seems no one responded, so I would try ...
>Joseph Pingenot <jap3003@ksu.edu> wrote:
>> I had a page validate as HTML 4.01, but have a space between the <
>>   and the img.  That is, I had (approximately):
>>   < img src="blar.jpg">
>>   validate.  However, it refused to render under any browser available
>>   to me (IE 6, Mozilla 0.9.3, and Netscape 4.78).  Is whitespace
>>   allowed between the leading < and the tag text, or is it a validator
>>   bug?
>White space is not allowed between the leading < (a.k.a. STAGO in SGML
>terminology) and the element name, however, this is NOT a validator bug.
>In SGML, when < is not followed by name characters, < is not treated as
>STAGO but just character data, so in your example, `< img src="blar.jpg">'
>is not treated as markup but as character data `<', a white space and
>the text string `img src="blar.jpg">'.  So long as #PCDATA is allowed
>there in a specified DTD, it just validates, but the result will not be
>what you intended, as browsers (correctly) rendered them as just text
>string.
>Note that in XML, when < is not used for markup, it must always be
>escaped, so (pseudo) markup like `< img src="blar.jpg"/>' will cause
>a well-formedness error.
>Hope this helps.
>Regards,
>Masayasu Ishikawa / mimasa@w3.org
>W3C - World Wide Web Consortium

-- 
Joseph==============================================jap3003@ksu.edu
"The message that 'resistance is futile' has been hammered home.
  The only OS projects that stand a chance [against Microsoft] are
  open source, because they don't play by the rules of the economy."
http://www.byte.com/documents/s=1115/byt20010824s0001
Received on Monday, 10 September 2001 15:59:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:59 GMT