Failed validation, 12 Errors

Status
Nicht offen für weitere Antworten.

blubbbla

Erfahrenes Mitglied
Also ich hab eine Seite durch den wc3 Validierer geschickt. Und natürlich gibts fehler. die Fehler liegen aber an dem charset bzw dem doctype.

ich weiß nicht genau, was udn wie ich alles festlegen muss:

- ich möchte utf8 kodierung
- und ich verwende xhtml. zumbeispiel bei <br /> (beo sowas zeigt er mir fehler an

was muss ich jetzt in meta daten oder doctype eintragen?

Wenn ich <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Und für die UTF-8 Kodierung das in den Header eintrage:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

bringt er mir trotzdem fehler wie:

- Character Encoding mismatch!

The character encoding specified in the HTTP header (iso-8859-1) is different from the value in the <meta> element (utf-8). I will use the value from the HTTP header (iso-8859-1) for this validation.

-<html>

Many Document Types based on XML need a mandatory xmlns="" on the root element. For example, the root element for XHTML will look like:
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">

und dann zeigt er alle fehler an, wo ich die tags mit /> schließe.
ich hab schon alles mögliche ausprobiert, aber immer mosert er rum :confused:
 
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<title>Seitentitel</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" media="projection, screen" /> <!-- globale Styles -->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="css/styles_ie.css" media="projection, screen" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="css/forms.css" media="projection, screen" /> <!-- Formulare -->
<link rel="stylesheet" type="text/css" href="css/print.css" media="print" /> <!-- Print Styles -->
</head>

Mal als Beispiel. Bei mir meckert er nicht rum. Das Transitional kannst du natürlich auch gegen Strict tauschen.

mfg
 
- Character Encoding mismatch!

The character encoding specified in the HTTP header (iso-8859-1) is different from the value in the <meta> element (utf-8). I will use the value from the HTTP header (iso-8859-1) for this validation.
Der Server, der die Seite ausliefert, sendet im Header-Bereich die Information, dass der Inhalt in ISO-8859-1 codiert ist. Das kann man z.B. über eine .htaccess-Datei ändern oder direkt in der jeweiligen Programmiersprache, falls die Seite dynamisch erzeugt wird.

Grüße,
Matthias
 
die seite kann ich leider nicht schicken,da ich die seite nicht veröffenttlichen darf :suspekt:

aber ich schick sie mal so:

Code:
Important Warnings

The validator has found the following problem(s) prior to validation, which should be addressed in priority:

   1. Warning Character Encoding Override in effect!

      The detected character encoding "iso-8859-1" has been suppressed and "utf-8" used instead.
   2. Warning Character Encoding mismatch!

      The character encoding specified in the HTTP header (iso-8859-1) is different from the value in the <meta> element (utf-8). I will use the value from the HTTP header (utf-8) for this validation.

? Top
Validation Output: 7 Errors

   1. Error Line 5, Column 66: document type does not allow element "html" here.

      …tp://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

      ?

      The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

      One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
   2. Error Line 95, Column 7: "head" not finished but document ended.

      </html>

      ?
   3. Error Line 95, Column 7: end tag for "head" omitted, but OMITTAG NO was specified.

      </html>

      ?

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
   4. Info Line 3, Column 0: start tag was here.

      <head>

   5. Error Line 95, Column 7: "html" not finished but document ended.

      </html>

      ?
   6. Error Line 95, Column 7: end tag for "html" omitted, but OMITTAG NO was specified.

      </html>

      ?

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
   7. Info Line 2, Column 0: start tag was here.

      <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

   8. Error Line 95, Column 7: XML Parsing Error: Premature end of data in tag head line 3.

      </html>

      ?
   9. Error Line 95, Column 7: XML Parsing Error: Premature end of data in tag html line 2.

      </html>

und ich hab das jetzt so auf der seite eingetragen:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html>
 
Ich finde die Fehlermeldungen sind eigentlich sehr selbsterklärend, da nicht nur der Fehler sondern auch mögliche Ursachen genannt werden. Arbeite die Fehler am besten von oben nach unten ab, da einige auch Folgefehler sein werden.
 
Status
Nicht offen für weitere Antworten.
Zurück