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
> >
> 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 :-)



Liam Quin - XML Activity Lead, W3C,
Pictures from old books:
Ankh: freenode/#xml
Co-author, 5th edn., "Beginning XML", Wrox, July 2012

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