RE: Validator parses HTML in CSS block comment?

Andreas,

We use XHTML because the wicket web framework recommends XHTML, and it's more strict than HTML4. Wicket does some limited validation of our XHTML syntax; but, it isn't comprehensive, and doesn't flag this case. I was running a snippet of the generated code through the W3C validator to troubleshoot a browser-specific rendering issue when I ran across this error.

I didn't know that script and style require CDATA in XHTML; it makes sense, but, it didn't occur to me. Maybe the W3C validator could detect this condition and provide a warning, before trying to parse the contained data? We'll correct our markup accordingly.

Thanks for your reply,

RUSSELL E. MORRISEY
Software Engineer, Staff
Mission Solutions Engineering, LLC

| Russell.Morrisey@missionse.com | www.missionse.com
304 West Route 38, Moorestown, NJ 08057-3212

-----Original Message-----
From: Andreas Prilop [mailto:aprilop@freenet.de]
Sent: Tuesday, August 16, 2011 2:10 PM
To: www-validator@w3.org
Cc: Russell Morrisey
Subject: Re: Validator parses HTML in CSS block comment?

On Mon, 15 Aug 2011, Russell Morrisey wrote:

> Do elements within a <style> tag, inside a /* block comment */,
> need to be HTML entity-escaped?
  ...
> The following HTML snippet reproduces the issue:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

You don't use HTML, you use XHTML.
But you do not understand the difference.
 http://www.w3.org/TR/xhtml1/#h-4.8

Stick to HTML 4 as long as you don't understand XHTML.

This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.

Received on Tuesday, 16 August 2011 18:28:07 UTC