Re: XHTML Validator not catching invalid attribute in CSS link tag

Jim Link wrote:

> I have an XHTML page that contains a typo in the "type" attribute of
> the link tag which refers to my CSS page.
>
> The XHTML Validator did not catch the typo.

That's because the typo did not generate a violation of the formalized 
syntax.

> The page is attached.

It would have been better to post the URL. (For one thing, some e-mail 
clients may automatically remove all attachments, or specifically HTML 
attachments, due to suspected virus/spam/whatever.)

> The typo is
>
> type="test/css"
>
> rather than the correct
>
> type="text/css"

In the formalized syntax, which is all that a markup validator (as opposite 
to other checkers) should care about, the declared type of the attribute is 
CDATA, which effectively means any character string.

The value "test/css" does not violate even the formal requirements on media 
types, defined outside HTML and not included in formalized HTML syntax. It 
is of the form x/y where x and y are identifiers, hence of the generic basic 
format of Internet media type names. There is currently no major media type 
called test (and probably there will never be), but this is casual as 
compared with formal requirements.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Received on Wednesday, 30 June 2010 16:57:34 UTC