W3C home > Mailing lists > Public > www-validator-css@w3.org > September 2004

Missing href on link element causes validation failure?

From: Paul Bryant <GAP66> <paul@gap66.com>
Date: Thu, 30 Sep 2004 01:14:29 +0100
To: <www-validator-css@w3.org>
Message-ID: <y7lxv6n0fgbs1y3.300920040114@mail.gap66.net>

If the validator finds a link element with no href attribute it reports the
error:

"Unrecognized link element or xml-stylesheet PI."

Missing any of the other implied attributes I've tested does not cause this
error - just href. Setting the href to an empty string fixes the problem
(unfortunately not a solution I can use). While a link with no href may not
seem practical, I have (fairly) valid reasons for wanting one. I'd like to
suggest that:
1/ the error message could be more explicit - "line X: no href attribute
found for link element" - using 'unrecognized' is misleading for valid (if
unlikely) code.
2/ this occurs regardless of whether the link element has a rel attribute or
not - why report errors for links that aren't stylesheets?
3/ as all of my css is valid, and the xhtml is valid, this should be
reported _outside_ the validation results, if at all, and the document
should not fail CSS validation for a non-css related issue/error. If a link
with rel="[alternate] stylesheet" has no href it may be worth reporting this
to the user - but is it invalid css?

Then again, possibly I'm wrong and probably the only person this applies to
anyway :)

Thanks,

Paul Bryant

++++++++ document that fails css validation (but passes as xhtml):


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>css test</title>
<style type="text/css">body{background:#fff}</style>
<link />
</head>
<body>css test</body></html>
Received on Thursday, 30 September 2004 00:14:52 GMT

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