Foros del Web » Creando para Internet » HTML »

Problemas w3c

Estas en el tema de Problemas w3c en el foro de HTML en Foros del Web. Hola, Primero deciros que soy novato y pediros ayuda. Después de solucionar 55 problemas ya solo me quedan 5 y con estos no puedo debido ...
  #1 (permalink)  
Antiguo 06/03/2011, 12:20
 
Fecha de Ingreso: febrero-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Problemas w3c

Hola, Primero deciros que soy novato y pediros ayuda.

Después de solucionar 55 problemas ya solo me quedan 5 y con estos no puedo debido a mi falta de formación.

Os paso el primero que después de hacer muchas pruebas no consigo solucionar.

validation Output: 5 Errors

Line 2, Column 121: DTD did not contain element declaration for document type name
….0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

A DOCTYPE declares the version of the language used, as well as what the root (top) element of your document will be. For example, if the top element of your document is <html>, the DOCTYPE declaration will look like: "<!DOCTYPE html".

In most cases, it is safer not to type or edit the DOCTYPE declaration at all, and preferable to let a tool include it, or copy and paste it from a trusted list of DTDs.

Line 3, Column 43: document type does not allow element "html" here
<html xmlns="http://www.w3.org/1999/xhtml">

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).



Código 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">
<head>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20200802-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
</script>
<title>Presentación | Alquiler Audiovisuales | Eventos | </title>
<meta name="Language" content="es" /> 

Última edición por Audiovisuales; 06/03/2011 a las 12:23 Razón: olvido cambio
  #2 (permalink)  
Antiguo 06/03/2011, 12:39
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 10 meses
Puntos: 1517
Respuesta: Problemas w3c

Es que al principio tienes declarado que vas a crear un HTML y luego dices que la información debe ser tomada de un XHTML, debes verificar bien tu doctype. En internet hay mucho material para que puedas hacerlo correctamente o simplemente copiar y pegar de algún enlace como el w3c.
Esta línea te lo dice que es bueno hacerlo como te estoy indicando
Cita:
In most cases, it is safer not to type or edit the DOCTYPE declaration at all, and preferable to let a tool include it, or copy and paste it from a trusted list of DTDs.
Y los errores restantes son por ese error.
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos
  #3 (permalink)  
Antiguo 06/03/2011, 12:58
 
Fecha de Ingreso: febrero-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Problemas w3c

Hola abimaelrc.

He probado con todos los Doctype que puedas imagina incluidos los de la pagina de w3, y todos peor que este, creo que con este los navegadores no se ponen en modo compatibilidad y responden bien, pero sigue dando este error que no se a que se debe. Si no fuera por que soy un poco cabezón, ya habría tirado la toalla.
Gracias.
  #4 (permalink)  
Antiguo 06/03/2011, 13:15
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 10 meses
Puntos: 1517
Respuesta: Problemas w3c

Trata, quitando de la etiqueta html la etiqueta xmlns. Aunque se supone que con eso no tengas problemas.
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos
  #5 (permalink)  
Antiguo 06/03/2011, 14:33
 
Fecha de Ingreso: febrero-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Problemas w3c

Si te entiendo bien quedaria así?

<!D
Código HTML:
OCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html="http://www.w3.org/1999/xhtml"> 
Pues si te entendí bien, no funciono.

Gracias
  #6 (permalink)  
Antiguo 06/03/2011, 14:49
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: Problemas w3c

Veo que utiliza el xhtml transitional.
Yo utilizo el strict siguiente y nunca me ha dado problemas:
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es-es">

Asegúrese que al copiarlo no se le cuele nada del editor. Lo mejor es pegarlo en el block de notas (o similar en otros SO) y de ahí al documento html.
  #7 (permalink)  
Antiguo 06/03/2011, 14:59
Avatar de sanxuan  
Fecha de Ingreso: enero-2011
Ubicación: Gijón
Mensajes: 671
Antigüedad: 13 años, 3 meses
Puntos: 36
Respuesta: Problemas w3c

Esta es la cabecera que correspondería a un documento XHTML1.0 de transicción según el w3c:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
La especificación XHTML1.0 se encuentra aquí:
http://www.w3.org/TR/xhtml1/#normative

Última edición por sanxuan; 06/03/2011 a las 15:14
  #8 (permalink)  
Antiguo 06/03/2011, 16:23
Avatar de zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: Problemas w3c

buenas...

el problema se reduce aqui, <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">. recuerda que xhtml es case-sensitive (sensible a mayusculas/minusculas). en la declaracion esta indicando que el elemento raiz es <HTML> en lugar de <html>. como ya te indicaron, es mas facil copiar el DTD de una fuente fiable, por ejemplo w3schools lista los tres XHTML DTD.

__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.
  #9 (permalink)  
Antiguo 06/03/2011, 16:51
 
Fecha de Ingreso: febrero-2011
Mensajes: 6
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Problemas w3c

Zerokilled, impresionante el detalle de las mayúsculas y el tiempo que yo le he podido echar y no me he dado cuenta.

Muchas gracias a todos.!!!.

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:29.