PDA

View Full Version : w3c won't validate my xhtml?


Mystic0
09-02-2004, 10:51 AM
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<HTML>
<TITLE>HTML and JavaScript</TITLE>
<BODY>
<CENTER><B>Creating HTML and JavaScript</B></CENTER>
<P>Learning to create HTML tags can help dudes in many ways:</P>
<P>Moving on to something more advanced.</P>
<P>Spam. <U>SPAM SPAM SPAM.</U></P>
<P>Spam and eggs.</P>
<P><B>Spam</B> <I>and</I> <B>eggs.</B></P>
</BODY>
</HTML>


The w3c validator tells me this:
<font face="Verdana, Arial" size="2">
Line 4, column 17: there is no attribute "HTTP-EQUIV"
</font>

------------------
Your humble opinion is wrong.

Cool Matty
09-02-2004, 12:34 PM
In XHTML there is no such thing as HTML-EQUIV. So get rid of it.

------------------
"The future is not determined by a throw of the dice, but is determined by the conscious decisions of you and me."
I am addicted to ellipses!!! AHHH!!! ...
Make Sorrowind Worthwhile... join it! http://sorrowind.net

Mystic0
09-02-2004, 04:19 PM
Okey, I started over by using some code that is supposedly valid according to www.w3school.com (http://www.w3school.com) While it is tenativly valid, it still claims that it cannot detect the charecter encoding. How does one declare the charecter encoding in XHTML?

Here is the code:

&lt;!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;simple document&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;a simple paragraph&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;


------------------
Your humble opinion is wrong.

[This message has been edited by Mystic0 (edited September 02, 2004).]

Molgrew
09-02-2004, 04:27 PM
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta content="text/html; charset=utf-8"
http-equiv="content-type" /&gt;
------------------
"Music is the universal language and the
dialect we speak in is Hip Hop!" - King Solomon


[This message has been edited by Molgrew (edited September 02, 2004).]

Mystic0
09-02-2004, 05:26 PM
Thank's for getting charecter encoding to work. However, I now have a new problem:

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta content="text/html; charset=utf-8"
http-equiv="content-type" /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Hello!&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;


Here is the output of the validator:
<font face="Verdana, Arial" size="2">
Line 7, column 8: end tag for "head" which is not finished
</font>

------------------
Your humble opinion is wrong.

Cool Matty
09-02-2004, 05:36 PM
It might require a &lt;title&gt;&lt;/title&gt; tag.

------------------
"The future is not determined by a throw of the dice, but is determined by the conscious decisions of you and me."
I am addicted to ellipses!!! AHHH!!! ...
Make Sorrowind Worthwhile... join it! http://sorrowind.net

Mystic0
09-02-2004, 05:37 PM
Huh? I added &lt;title&gt;&lt;/title&gt; inside &lt;head&gt;&lt;/head&gt; and now all of the sudden it works?

------------------
Your humble opinion is wrong.

Mystic0
09-02-2004, 05:38 PM
Heh, what a coincidence. Guess that was it! http://forums.massassi.net/html/smile.gif

------------------
Your humble opinion is wrong.

herb
09-02-2004, 07:03 PM
XHTML means strict structure. &lt;title&gt; happens to be one of those required ones.