Foros del Web » Creando para Internet » HTML »

Ayuda con validación W3C

Estas en el tema de Ayuda con validación W3C en el foro de HTML en Foros del Web. Buenas! Necesito un poco de ayuda con este HTML sencillo... Necesito validarlo por W3C pero me da 3 errores... Código: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ...
  #1 (permalink)  
Antiguo 20/04/2010, 16:57
 
Fecha de Ingreso: abril-2010
Mensajes: 76
Antigüedad: 14 años
Puntos: 0
Ayuda con validación W3C

Buenas!

Necesito un poco de ayuda con este HTML sencillo... Necesito validarlo por W3C pero me da 3 errores...

Código:
<!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> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Documento sin título</title> 
</head> 
 
<body> 
<iframe src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe> 
</body> 
</html>
ERRORES:
Line 9, Column 72: cannot generate system identifier for general entity "p"
…src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe>
-
An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.

If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.

Line 9, Column 72: general entity "p" not defined and no default entity
…src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe>
-
This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

Line 9, Column 73: reference not terminated by REFC delimiter
…src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe>
-
If you meant to include an entity that starts with "&", then you should terminate it with ";". Another reason for this error message is that you inadvertently created an entity by failing to escape an "&" character just before this text.

Line 9, Column 73: reference to external entity in attribute value
…src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe>
-
This is generally the sign of an ampersand that was not properly escaped for inclusion in an attribute, in a href for example. You will need to escape all instances of '&' into '&amp;'.

Line 9, Column 73: reference to entity "p" for which no system identifier could be generated
…src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe>
-
This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

Line 9, Column 71: entity was defined here
…src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe>
Line 9, Column 72: EntityRef: expecting ';'
…src='http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'></iframe>
-


Gracias de antemano!
  #2 (permalink)  
Antiguo 20/04/2010, 18:34
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Ayuda con validación W3C

Como estás Tai.
el primer problema creo que te lo originó el editor dónde realizaste el código, la letra "í" de "documento sin título" aparece como un caracter extraño. editalo con el block de notas y pon la í correcta.
el segundo es porque en la query de
http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&p=383'
debes reemplazar & por su entidad html que es &amp;
debería quedarte entonces
http://www.aemet.es/es/eltiempo/prediccion/provincias?w=2&amp;p=383'

Saludos
  #3 (permalink)  
Antiguo 21/04/2010, 05:26
 
Fecha de Ingreso: abril-2010
Mensajes: 76
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda con validación W3C

Muchas Gracias!! Funciono perfectamente!!
  #4 (permalink)  
Antiguo 22/04/2010, 17:01
 
Fecha de Ingreso: abril-2010
Mensajes: 76
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda con validación W3C

Necesito un poco mas de ayuda...

A ver si alguien me puede ayudar a validar este HTML por W3C

Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
  <head> 
  <meta http-equiv="content-type" content="text/html; charset=windows-1250"> 
 
  <title></title> 
<script type="text/javascript" src="Themes/tabs/tabs.js"></script>  
    <link type="text/css" media="all" href="Themes/tabs/tabstyle.css" rel="stylesheet">    
  </head> 
  <body> 
 
 
<script language="JavaScript" type="text/javascript"> 
//<![CDATA[
 
function RutaGraficoMeteored(Tau){
var RutaBase="http://imagenes.meteored.com/gfs_meteored/";
var Ruta01=RutaBase + "GFS" + Tau + "_ESP0_" + "SFC.gif";;
var Ruta02=RutaBase + "GFS" + Tau + "_ESP0_" + "500.gif";
var Ruta03=RutaBase + "GFS" + Tau + "_ESP0_" + "10M.gif";
 
//se muestra la carga
target = document.getElementById( "cargandoMeteored" );
target.style.display = "";
target.scr= "Themes/default/images/loading.gif";
 
document.getElementById("Meteored1").src = Ruta01;
document.getElementById("enlaceMeteored1").href = Ruta01;
document.getElementById("Meteored2").src = Ruta02;
document.getElementById("enlaceMeteored2").href = Ruta02;
document.getElementById("Meteored3").src = Ruta03;
document.getElementById("enlaceMeteored3").href = Ruta03;
}
 
function imagencargada(){
if (document.getElementById("Meteored1").src == "Themes/default/images/loading.gif"){
  return;
  }
 
target = document.getElementById( "cargandoMeteored" );
 
if (target.scr == "Themes/default/images/loading.gif") {
  target.style.display = "none";
  target.scr= "Themes/default/images/blank.gif";
}
 
}
 
 
//]]>
</script>       
 
<!--- Inicio del Panel --> 
<div class="tborder" style="margin-top: 0ex;"> 
      <div class="catbg" style="padding: 0px 0px 0px 0px;"> 
      <a name="name"></a> 
      </div> 
      <div id="panel"> 
            <input type="button" name="Boton1" value="+12H" OnClick="RutaGraficoMeteored('012');" title="Pronostico +12H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+18H" OnClick="RutaGraficoMeteored('018');" title="Pronostico +18H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+24H" OnClick="RutaGraficoMeteored('024');" title="Pronostico +24H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+30H" OnClick="RutaGraficoMeteored('030');" title="Pronostico +30H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+36H" OnClick="RutaGraficoMeteored('036');" title="Pronostico +36H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+42H" OnClick="RutaGraficoMeteored('042');" title="Pronostico +42H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+48H" OnClick="RutaGraficoMeteored('048');" title="Pronostico +48H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+54H" OnClick="RutaGraficoMeteored('054');" title="Pronostico +54H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+60H" OnClick="RutaGraficoMeteored('060');" title="Pronostico +60H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+66H" OnClick="RutaGraficoMeteored('066');" title="Pronostico +66H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+72H" OnClick="RutaGraficoMeteored('072');" title="Pronostico +72H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+84H" OnClick="RutaGraficoMeteored('084');" title="Pronostico +84H" style="font-size: 8pt"/>                        
            <input type="button" name="Boton1" value="+90H" OnClick="RutaGraficoMeteored('090');" title="Pronostico +90H" style="font-size: 8pt"/> 
            <input type="button" name="Boton1" value="+96H" OnClick="RutaGraficoMeteored('096');" title="Pronostico +96H" style="font-size: 8pt"/> 
 
      
      <table class="bordercolor" style="margin-top: 1px;" border="0" cellpadding="5" cellspacing="1" width="100%"> 
 
        <tbody> 
 
          <tr> 
          
            <td class="windowbg2"> 
      <div name="cargandoMeteored" id="cargandoMeteored"> 
      <img name="cargandoimg" id="cargandoimg" src="Themes/default/images/loading.gif"  border="0" /> 
      </div> 
 
      <div id="TabContentMeteored" style="font-size: 80%">    
       <ul class="tabset_tabs"> 
        <li><a class="active" href="javascript:void(0);" onclick="expandcontent('1', this, 'TabContentMeteored', 'TabContainerMeteored')">Pres.niv.Mar + Nubosidad + 6H prec.</a> </li> 
        <li><a class="PreActive" href="javascript:void(0);" onclick="expandcontent('2', this, 'TabContentMeteored', 'TabContainerMeteored')">500hPa Temp + Viento</a> </li> 
        <li><a class="PreActive" href="javascript:void(0);" onclick="expandcontent('3', this, 'TabContentMeteored', 'TabContainerMeteored')">Pres.niv.Mar + Viento</a> </li> 
      </ul> 
     </div> 
     
 
      <div id="TabContainerMeteored">	       
            
       <div id="tab1" class="tabset_content_active"> 
        <h2 class="tabset_label">Pres.niv.Mar + Nubosidad + 6H prec.</h2>     
            <a id="enlaceMeteored1" target="_blank"><img name="Meteored1" id="Meteored1" src="Themes/default/images/loading.gif" onLoad=imagencargada() border="0" /></a> 
        </div>    
      
      <div id="tab2" class="tabset_content"> 
        <h2 class="tabset_label">500hPa Temp + Viento</h2> 
             <a id="enlaceMeteored2" target="_blank"><img name="Meteored2" id="Meteored2" src="Themes/default/images/loading.gif"  border="0" /></a> 
       </div>   
            
      <div id="tab3" class="tabset_content"> 
        <h2 class="tabset_label">Pres.niv.Mar + Viento</h2> 
            <a id="enlaceMeteored3" target="_blank"><img name="Meteored3" id="Meteored3" src="Themes/default/images/loading.gif"  border="0" /></a> 
      </div> 
 
 
 
       </div> 
 
 
 
 
            
             </td> 
 
          </tr> 
 
 
 
        </tbody> 
      </table> 
<script language="JavaScript" type="text/javascript"> 
//<![CDATA[
RutaGraficoMeteored('012');
//]]>
</script>       
      
      </div> 
 
</div> 
 
 
 
 
 
 
  </body> 
</html>

Me da infinidad de errores...

Gracias de antemano
  #5 (permalink)  
Antiguo 22/04/2010, 18:20
Tew
 
Fecha de Ingreso: enero-2006
Mensajes: 1.562
Antigüedad: 18 años, 3 meses
Puntos: 17
Respuesta: Ayuda con validación W3C

Te da infinidad de errores (concretamente 7) y a para cada uno de ellos te expone la solucion. Simplemente debes mirarlo y no pretender que te den el trabajo hecho

Un par de ejemplos:

Line 82, Column 17: there is no attribute "NAME"
<div name="cargandoMeteored" id="cargandoMeteored">

Line 99, Column 164: required attribute "ALT" not specified
…c="Themes/default/images/loading.gif" onLoad=imagencargada() border="0" /></a>
  #6 (permalink)  
Antiguo 22/04/2010, 18:24
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Ayuda con validación W3C

Primero te diré, lo ideal seía que tus páginas sean válidas y POR QUE deben serlo.
Dices que te tira numerosos errores, pues bien, el validador te da una referencia a dichos errores, las leiste?
Result: 7 errors / 0 warnings

line 82 column 16 - Error: there is no attribute "NAME"
line 83 column 99 - Error: required attribute "ALT" not specified
line 99 column 136 - Error: there is no attribute "ONLOAD"
line 99 column 149 - Error: an attribute value must be a literal unless it contains only name characters
line 99 column 163 - Error: required attribute "ALT" not specified
line 104 column 142 - Error: required attribute "ALT" not specified
line 109 column 141 - Error: required attribute "ALT" not specified

Puede que algunas sean un poco difíciles de entender, pero que el atributo "ALT" es requerido por el tag "IMG", incluso cuando esté vacio de contenido, es algo muy básico
NAME no es un atributo de DIV, para eso usas id=""
El atributo "onload" , solo es aplicable al BODY o los FRAMESET

Tew, se me acaba de adelantar con su post, empieza a trabajar un poco

Te recomiendo que trabajes con Firefox con la extensión WebdeVeloper instalada.

Saludos
  #7 (permalink)  
Antiguo 22/04/2010, 18:49
 
Fecha de Ingreso: abril-2010
Mensajes: 76
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda con validación W3C

Lo siento, tienen toda la razón... Y les doy las gracias por vuestros comentarios que de igual forma me han ayudado muchísimo!!... he conseguido corregir todos los errores... solo me falta lo warnings... que me advierte de "SHORTTAG" lo investigare...


GRACIAS!!
  #8 (permalink)  
Antiguo 22/04/2010, 19:02
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Ayuda con validación W3C

Buen comienzo

Etiquetas: validar
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 11:39.