Re: Markup Validation Service: one parsing error.

Hello SeongTae Jeong,

Sorry for the late reply.

Most likely you’re using Microsoft IIS, which is known to change the markup of the pages it serves in order to make it (the markup) understandable by legacy browsers when it (IIS) encounters a User-Agent header it doesn't know. You can see the actual markup the validator gets by using the “show source” option. I guess that you will find out that your server indeed sends a <font> tag instead of the style attribute you put in your code.

The solution to this issue is to tell IIS that the W3C’s validator is a fully capable user agent. From <http://msdn.microsoft.com/en-us/library/exc57y7e.aspx#sectionToggle4>:
> You can configure your application to send the correct XHTML-conformant markup to the validation service by creating a browser definition for the validation service's user agent string. For example, the W3C Markup Validation Service reports a user agent that begins with "W3C_Validator". To create a browser definition for the W3C validator, you can create a .browser file in your application's App_Browsers folder (you can name the .browsers file anything you like) and then add the following browsers element.
> 
> <browsers>
>   <browser id="W3C_Validator" parentID="default">
>     <identification>
>         <userAgent match="^W3C_Validator" />
>     </identification>
>     <capabilities>
>       <capability name="browser"              value="W3C Validator" />
>       <capability name="ecmaScriptVersion"    value="1.2" />
>       <capability name="javascript"           value="true" />
>       <capability name="supportsCss"          value="true" />
>       <capability name="tables"               value="true" />
>       <capability name="tagWriter" 
>          value="System.Web.UI.HtmlTextWriter" />
>       <capability name="w3cdomversion"        value="1.0" />
>     </capabilities>
>   </browser>
> </browsers>
> 


Le 8 juin 2011 à 03:09, SeongTae Jeong a écrit :

> Hello,
>  
> Only one report here, with that service “Markup Validation Service” - http://validator.w3.org/, I meet a very strange validation error as follows,
>  
> “
> Line 318, Column 73: The font element is obsolete. Use CSS instead.
> …       <span id="lbl_TodayWritten"><font color="#C00000">0</font></span>
> “
>  
> But, html text is,
>  
> <span id="lbl_TodayWritten" style="color:#C00000;">0</span>
> 
> “Markup Validation Service” produces ‘style=…’ as separate font tag.
>  
> Anyway, I just got a workaround with css class,
> 
> .mycolor
> {
>   color: #c00000;
> }
> <span id=”…” class=”mycolor” />
>  
>  

Best regards,

-- 
Etienne Miret

Received on Monday, 27 June 2011 14:13:31 UTC