W3C home > Mailing lists > Public > www-validator-css@w3.org > January 2007

Re: javascript validation problems

From: David Dorward <david@dorward.me.uk>
Date: Tue, 16 Jan 2007 18:42:46 +0000
To: Jason Millward <jmillward@oneadvertising.co.uk>
Cc: www-validator-css@w3.org
Message-ID: <20070116184246.GI8811@us-lot.org>

On Tue, Jan 16, 2007 at 04:04:03PM -0000, Jason Millward wrote:
>    Below is a list of the warning message(s) produced when validating
>    your document.
>     1. Warning Line 15 column 18: character "&" is the first character of
>        a delimiter but occurred as data.

IIRC correctly this should be an error, not a warning, and clients are
supposed to fall over on it.
 
>           + You used an unescaped ampersand "&": this may be valid in
>             some contexts, but it is recommended to use "&amp;", which is
>             always safe.

Those contexts are specific to HTML and don't apply in XHTML.

>    but when I used the css validator I get the following error:
>    Please, validate your XML document first!
>    The entity name must immediately follow the '&' in the entity
>    reference.

Yes, it is an error, not a warning. The CSS validator couldn't parse
the XML because it had such an error in it.
 
>    Is there anything I can do to bypass this or is it possible to change
>    the javascript so it is valid?

As it said - 'it is recommended to use "&amp;"'

... except you are serving XHTML as text/html and have to contend with
the joys of having to make the XHTML as much like HTML as possible.

Since text/html XHTML can't gain any of the client side benefits of
XHTML I suggest you switch to HTML 4.01 (either in your source
document, or in a transformation during the publishing or serving
phase).

If you want to stick with XHTML, then I suggest you reread the
sections on script and style elements in the spec (in the changes from
HTML 4.01 section and in Appendix C).

(on the subject of Appendix C, you should also check out C2 as you are
missing some trailing spaces)

http://www.w3.org/TR/xhtml1/

-- 
David Dorward                                      http://dorward.me.uk
Received on Tuesday, 16 January 2007 18:42:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 00:14:18 GMT