Re: Comment syntax

On Tue, 2012-08-28 at 15:08 +0800, Kang-Hao (Kenny) Lu wrote:

> >> What is attribute value normalization?
> > 
> > In XML and SGML attributes, newlines are converted to spaces by the
> > parser. E.g. see
> > http://www.w3.org/TR/REC-xml/#AVNormalize
> 
> Thanks for the link. So, it's (surprisingly) true that you can't use
> //-style comments in XHTML. Test cases:

Note that it's not only XML but also SGML, so that versions of HTML
defined as SGML vocabularies also, strictly speaking, inherit this
behaviour. I don't know what HTML 5 and/or "modern Web browsers"
actually do.

It's explained in B.5.1.2 of the SGML spec, if you care :-)

Best

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Co-author, 5th edn., "Beginning XML", Wrox, July 2012

Received on Sunday, 2 September 2012 18:33:33 UTC