473,509 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XHTML validation problem at W3C with stylesheet link

I don't seem to be getting anywhere with trying to make my web page
transitional XHTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

There are many errors returned at the W3C validator but the first one
has me stumped. It's my stylesheet link tag.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">

The W3C validator says this about it:

Line 9, column 10: there is no attribute "REL" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 28: there is no attribute "HREF" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 46: there is no attribute "type" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 56: element "LINK" undefined (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
The W3C explanations of these errors leave a lot to be desired.

I tried many variations and got pretty much the same results.

Can anyone explain this and tell me how to fix it?

Also, is there supposed to be a namespace tag on the second line?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Thanks for your help.
Jul 20 '05 #1
17 8491
"Bruce W...1" <br***@noDirectEmail.com> wrote:
I don't seem to be getting anywhere with trying to make my web page
transitional XHTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
That looks correct.
There are many errors returned at the W3C validator but the first one
has me stumped. It's my stylesheet link tag.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">

The W3C validator says this about it:

Line 9, column 10: there is no attribute "REL" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 28: there is no attribute "HREF" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
Line 9, column 46: there is no attribute "type" (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
^
The three errors above are all symptoms of the error below. Fix this
and they will vanish.
Line 9, column 56: element "LINK" undefined (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
Well, something's wrong but based on what you've told us it's
impossible to tell what. Give us the URL so we can check it all out.
Also, is there supposed to be a namespace tag on the second line?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


Yes, that's correct.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2
On Fri, 28 Nov 2003 18:46:29 -0500, "Bruce W...1"
<br***@noDirectEmail.com> wrote:
I don't seem to be getting anywhere with trying to make my web page
transitional XHTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

There are many errors returned at the W3C validator but the first one
has me stumped. It's my stylesheet link tag.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">

[snip]

Note that you have to use lower case in XHTML (yes, even in
transitional).

<link rel="stylesheet" href="styles.css" type="text/css">

Should validate (it does for me anyway)
Jul 20 '05 #3
"Bruce W...1" <br***@noDirectEmail.com> wrote:
I don't seem to be getting anywhere with trying to make my web page
transitional XHTML.
So why are you trying that? You _won't_ get anywhere by just "using
XHTML", which these days mostly means throwing some technobabble here
and some slashes there and getting confused. Besides, you're not using
the slashes. Oh, and you're not using lowercase.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">
In XHTML, all elements must have end tags, and all element and
attribute names must be in lower case. If you didn't know this, _why_
are you using XHTML? We could tell you to use
<link rel="stylesheet" href="styles.css" type="text/css" />
but that would just mean some steps in a useless game of "using XHTML"
for the sake of using XHTML.
The W3C explanations of these errors leave a lot to be desired.
Sorry, but the validator is simply doing what you asked it to do. It's
not its fault that you didn't know what you were asking for.
Also, is there supposed to be a namespace tag on the second line?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">


In XHTML, the xmlns attribute (which is probably what you mean by
"namespace tag") is required by the prose description. A validator
won't care, though, due to the way the attribute is declared - yet
another reminder of the fact that validation does not imply conformance
to a specification.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #4
Steve Pugh <st***@pugh.net> wrote:
"Bruce W...1" <br***@noDirectEmail.com> wrote:
Line 9, column 56: element "LINK" undefined (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">


Well, something's wrong but based on what you've told us it's
impossible to tell what.


Like hell it is...

I can't believe I missed that. This is XHTML. Element and attribute
names must be lowercase. I'll just go stand in the corner.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #5
Quoth the raven named Steve Pugh:
Steve Pugh <st***@pugh.net> wrote:
"Bruce W...1" <br***@noDirectEmail.com> wrote:
Line 9, column 56: element "LINK" undefined (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">


Well, something's wrong but based on what you've told us it's
impossible to tell what.


Like hell it is...

I can't believe I missed that. This is XHTML. Element and attribute
names must be lowercase. I'll just go stand in the corner.


Not only lowercase, but it needs a closing /

<link rel="stylesheet" href="styles.css" type="text/css" />

OP: All XHTML elements that don't have a closing tag need a closing slash.

<img src="..." alt="..." ... /> <br /> and so on.

--
-bts
-This space intentionally left blank.

Jul 20 '05 #6
"Beauregard T. Shagnasty" <a.*********@example.invalid> wrote:
Quoth the raven named Steve Pugh:
Steve Pugh <st***@pugh.net> wrote:
"Bruce W...1" <br***@noDirectEmail.com> wrote:

Line 9, column 56: element "LINK" undefined (explain...).
<LINK REL="stylesheet" HREF="styles.css" type="text/css">

Well, something's wrong but based on what you've told us it's
impossible to tell what.


Like hell it is...

I can't believe I missed that. This is XHTML. Element and attribute
names must be lowercase. I'll just go stand in the corner.


Not only lowercase, but it needs a closing /

<link rel="stylesheet" href="styles.css" type="text/css" />


Likely but not necessarily so.
As the OP didn't post the whole source or a URL we don't know whether
there was </link> in there as well. From the error messages quoted
there's no way to tell.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #7
Paul D. J. Vandenberg wrote:
On Fri, 28 Nov 2003 18:46:29 -0500, "Bruce W...1"
<br***@noDirectEmail.com> wrote:

I don't seem to be getting anywhere with trying to make my web page
transitional XHTML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

There are many errors returned at the W3C validator but the first one
has me stumped. It's my stylesheet link tag.
<LINK REL="stylesheet" HREF="styles.css" type="text/css">

[snip]

Note that you have to use lower case in XHTML (yes, even in
transitional).

<link rel="stylesheet" href="styles.css" type="text/css">

Should validate (it does for me anyway)

It does not validate for me. Should be:

<link rel="stylesheet" href="styles.css" type="text/css"/>

;-)

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #8
Anne van Kesteren wrote:
It does not validate for me. Should be:

<link rel="stylesheet" href="styles.css" type="text/css"/>


Only if you don't care about MSIE. If you want to send it according to
Appendix C (i.e. as HTML) then you need a space before the slash.

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #9
David Dorward wrote:
It does not validate for me. Should be:

<link rel="stylesheet" href="styles.css" type="text/css"/>
Only if you don't care about MSIE.


Afaik IE does not have a problem sans space.
If you want to send it according to
Appendix C (i.e. as HTML) then you need a space before the slash.


The space is not a requirement, just a hack to make it more compatible
with really old and obscure UA's IIRC.

--
Spartanicus
Jul 20 '05 #10
Spartanicus wrote:
David Dorward wrote:
Only if you don't care about MSIE.

The topic was about validating XHTML.
Afaik IE does not have a problem sans space.
for IE/WIN 5.x+ that is correct. For other IE's: I don't know.
The space is not a requirement, just a hack to make it more compatible
with really old and obscure UA's IIRC.


It is: <http://www.w3.org/TR/xhtml1/#C_2>
--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #11
Anne van Kesteren wrote:
The space is not a requirement, just a hack to make it more compatible
with really old and obscure UA's IIRC.


It is: <http://www.w3.org/TR/xhtml1/#C_2>


Appendix C is not a requirement (must), only a practical recommendation
aka hack.

--
Spartanicus
Jul 20 '05 #12
On Sat, 29 Nov 2003 11:21:47 +0000, Spartanicus <me@privacy.net>
wrote:
Anne van Kesteren wrote:
The space is not a requirement, just a hack to make it more compatible
with really old and obscure UA's IIRC.


It is: <http://www.w3.org/TR/xhtml1/#C_2>


Appendix C is not a requirement (must), only a practical recommendation
aka hack.


Unless you wish to serve it as text/html in which case it is required
by RFC 2854 (of course RFC2854 also lets you serve tag-soup as
text/html, so you can ignore App. C and say you're serving tag-soup
and not worry)

There is certainly no requirement to include a space when authoring
XHTML, and appendix C is wholly pointless and should be removed in
errata, however the XHTML working group are many months over due
responding to the relevant issue, and seemingly refuse to respond to
this. However W3 process is flawed and there's nothing we do except
appeal to the Activity people - who just happen to be the same in the
case of HTML...

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #13
Jim Ley wrote:
The space is not a requirement, just a hack to make it more compatible
with really old and obscure UA's IIRC.

It is: <http://www.w3.org/TR/xhtml1/#C_2>
Appendix C is not a requirement (must), only a practical recommendation
aka hack.


Unless you wish to serve it as text/html in which case it is required
by RFC 2854


The context is using a space before closing an empty element in XHTML,
this is not dealt with in RFC 2854.
appendix C is wholly pointless and should be removed in errata


A contradiction in terms, errata further clarifies things or points out
errors, it does not "remove" anything.

--
Spartanicus
Jul 20 '05 #14
In article
<ho********************************@news.spartanic us.utvinternet.ie>,
Spartanicus <me@privacy.net> wrote:
appendix C is wholly pointless and should be removed in errata


A contradiction in terms, errata further clarifies things or points out
errors, it does not "remove" anything.


I think the point here is that the entire Appendix C is considered an
error by some.

--
Henri Sivonen
hs******@iki.fi
http://iki.fi/hsivonen/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 20 '05 #15
On Tue, 02 Dec 2003 14:24:34 +0000, Spartanicus <me@privacy.net>
wrote:
Jim Ley wrote:
Unless you wish to serve it as text/html in which case it is required
by RFC 2854


The context is using a space before closing an empty element in XHTML,
this is not dealt with in RFC 2854.


Of course it is, RFC 2854 gives authority to serve XHTML based on the
profile described in XHTML 1 - Appendix C is that profile.
appendix C is wholly pointless and should be removed in errata


A contradiction in terms, errata further clarifies things or points out
errors, it does not "remove" anything.


Yes, the contradictory thing is Appendix C. It's self contradictory
(C1 and C14) as well as being wrong in many other ways.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #16
What Jukka K. Korpela was saying is correct. You were writing HTML 4.01
Transitional not XHTML 1.0 Transitional. You should use HTML 4.01
unless you don't mind retyping it. It must follow the rules for XML
with lower-case attributes and elements. The only reason to use XHTML
right now is if you are potentially going to release XML data into the
document through IFRAMEs. You probably don't need XML documents in your
website. Because of that, you should use HTML.
--------------------------------------------------------------------------
Jukka K. Korpela wrote:
"Bruce W...1" <br***@noDirectEmail.com> wrote:

I don't seem to be getting anywhere with trying to make my web page
transitional XHTML.

So why are you trying that? You _won't_ get anywhere by just "using
XHTML", which these days mostly means throwing some technobabble here
and some slashes there and getting confused. Besides, you're not using
the slashes. Oh, and you're not using lowercase.

<LINK REL="stylesheet" HREF="styles.css" type="text/css">

In XHTML, all elements must have end tags, and all element and
attribute names must be in lower case. If you didn't know this, _why_
are you using XHTML? We could tell you to use
<link rel="stylesheet" href="styles.css" type="text/css" />
but that would just mean some steps in a useless game of "using XHTML"
for the sake of using XHTML.

The W3C explanations of these errors leave a lot to be desired.

Sorry, but the validator is simply doing what you asked it to do. It's
not its fault that you didn't know what you were asking for.

Also, is there supposed to be a namespace tag on the second line?
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">

In XHTML, the xmlns attribute (which is probably what you mean by
"namespace tag") is required by the prose description. A validator
won't care, though, due to the way the attribute is declared - yet
another reminder of the fact that validation does not imply conformance
to a specification.


Jul 20 '05 #17
True Gamer:
The only reason to use XHTML
right now is if you are potentially going to release XML data into the
document through IFRAMEs.
Iframes? What have Iframes to do with this?
You probably don't need XML documents in your
website. Because of that, you should use HTML.


There can be other good reasons for using XHTML.

--
Bertilo Wennergren <be******@gmx.net> <http://www.bertilow.com>

Jul 20 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2512
by: seajays | last post by:
I've got my page working just as I wanted it - but when I came to validate the XHTML, using W3c's validator it failed. Essentially as far as I can see it the problem is this: 1: <div> 2: <a...
12
3142
by: Dave Hammond | last post by:
I recently noticed the stylesheet link in an html page had the href set to a PHP script, as in: <LINK REL="stylesheet" href="some_css.php" type="text/css"> Presumably the file being referenced...
3
4126
by: Max_Us | last post by:
hi everyone. I'm getting the following warning of Encodinf Mistmatch: > Character Encoding mismatch! > > The character encoding specified in the HTTP header (iso-8859-1) is > different from...
1
2272
by: johoward | last post by:
The javascript we use to help protect against email address harvesting is causing the following error when trying to validate XHTML 1.0 Transitional: Line 91 column 172: character ";" not allowed...
21
2696
by: peteski22 | last post by:
How can I get my webpage to validate to XHTML strict if I am using the commands as given in the phpthumb demo: <img src="../phpThumb.php?src=images/disk.jpg&w=200"> This gives validation...
0
1070
by: eurorscg | last post by:
Hi, i have this dropdownlist that breaks xhtml w3c validation.because it generates a select tag with a javascript property. this only happens when autopostback is set to true. so the the...
1
3819
by: C.W.Holeman II | last post by:
I have an xmlns attribute that produces an XHTML validation error and I do not understand why it is considered an error.The file displays as expected on Firefox and IE7. ...
6
3580
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
I want to insert a CSS Stylesheet file in a <LINKtag inside my MasterPage so that it will work in all of the the ASPX pages that use that MasterPage (no matter where the page is in the directory...
4
2501
by: DonD | last post by:
I have a site that uses a bit of flash and I include a link for visitors to get flash if they don't have it. Unfortunately, the XHTML validator complains about the "get flash" url, even when using...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.