Posted by Benjamin Niemann on 06/12/06 21:42
Andy Dingley wrote:
>
> Jim Higson wrote:
>> I just noticed that not separating attributes by spaces is picked up by
>> some validators/checkers and not others.
>
> "Any number of (legal) attribute value pairs, separated by spaces, may
> appear in an element's start tag."
> http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2
> So you do need the spaces in HTML (inc Appendix C XHTML).
Chapter 3 "On SGML and HTML" is not a normative specification of the SGML
syntax. (Would be great, if SGML was so simple that it could be described
in this single chapter ;) )
> The production for attributes in XML
> http://www.w3.org/TR/2004/REC-xml11-20040204/#sec-starttags
> also requires spaces, so you require them in XML, including XHTML as
> application/xhtml+xml.
XML is stricter than SGML. And one of the problems of the w3c validator is
that the parser (still) uses (some) SGML rules when it processes XHTML.
That's why it is currently not reporting such syntax errors is XHTML.
> I offer no explanation of the W3C's parser not reporting the
> well-formedness error. I don't think this is some SGML subtlety
It is. The space is optional as long as it is unambiguous.
> (which
> would be forbidden by ther text of the HTML TR anyway).
The w3c validator is just a (slightly tuned) SGML validator. It does not
know any special HTML rules (even if the spaces were mandatory in HTML).
> It's probably
> another manifestation of the less than perfect nature of the W3C
> validator when used on XML-as-XML.
Yup.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
[Back to original message]
|