misterhaan | 1 Aug 2008 21:52
Favicon

Send the HTTP request Accept header


i was getting a warning when trying to validate any page on my site that 
the mime type is text/html instead of application/xhtml+xml when the 
document type is xhtml 1.1.  at the time i was using code very similar 
to what was suggested under the “setting the mime type with php” heading 
of the document [1] the validator’s warning message linked to:

if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml"))
    header("Content-Type: application/xhtml+xml; charset=utf-8");
else
    header("Content-Type: text/html; charset=utf-8");

if you’re curious, i’m using stripos() !== false instead of stristr(), 
but other than that (and that i use single quotes and don’t put a space 
after if) i came up with identical code on my own.

the problem is that when the w3c html validator looked at my site, the 
Accept header was blank or missing, so my server sent text/html.  i’ve 
now updated my logic to say if accept contains application/xhtml+xml or 
doesn’t contain text/html, send application/xhtml+xml; otherwise fall 
back to text/html.

i think that since the validator can in fact accept 
application/xhtml+xml, it should say so in the Accept header.  i’d like 
to see application/xhtml+xml, text/html and all other mime types the 
validator is capable of validating sent in the Accept header when 
requesting a file to validate.

thanks!

(Continue reading)

olivier Thereaux | 2 Aug 2008 23:54
Picon
Favicon

Re: Send the HTTP request Accept header


Hello,

On 1-Aug-08, at 3:52 PM, misterhaan wrote:
> i was getting a warning when trying to validate any page on my site  
> that the mime type is text/html instead of application/xhtml+xml  
> when the document type is xhtml 1.1.  at the time i was using code  
> very similar to what was suggested under the “setting the mime type  
> with php” heading of the document [1] the validator’s warning message
[...]

Answers at: http://www.w3.org/Bugs/Public/show_bug.cgi?id=5900

cheers,
--

-- 
olivier

H. Hahn | 3 Aug 2008 17:07
Picon

Problem with validating password-protected pages

L.S.,

While developing a website, I wanted to validate a certain page that is password-protected. As I was logged in at a sufficiently high level, having access to all pages, I tacitly expected the validator to have the same rights as its invoker (i.e., me) had.
First of all, I noticed that the validator completed the validation much quicker than I was used to. Also, and error and a warning were reported that in no way could apply to the page I tried to validate.

Only after I re-validated with displaying the complete source code, I found that it had not validated the requested page, but the "Page not found" page. Basically, this was correct, as the validator apparently was refused access to the page.

However, both the validator's address field and the validation result text mentioned the correct URL of the original page, without any mention of the "Page not found" page.

As I see it, it would be better -- and more correct as well -- when in such a case the validator would report something like:
"You requested validation of page 'www.domain.com?id=pagetwentyfive&blahblabla'. However, the validator found itself redirected to page 'www.domain.com/pagenotfound.php'. For the latter page, the validation results were:..."
Would it perhaps be a good suggestion if you change this? After all, when a browser is redirected this way, its address field does show the URL of the page actually shown. So this information is available at the moment the report is being compiled and the two URLs can simply be compared.

Thank you very much in advance.

Sincerely,
Hahn Informatica
Ir. H. Hahn
Braak 48
NL-5501DK  Veldhoven
Nederland / Niederlande / Netherlands
Tel. +31 40 2300161
Fax +31 40 2300163
E-mail: h.hahn <at> hahn-informatica.nl
Website: www.hahn-informatica.nl
BTW/MWSt/VAT: NL 092 081 046 B01
KvK/IHK/RC: NL 170 62224

olivier Thereaux | 4 Aug 2008 16:04
Picon
Favicon

Re: XHTML Basic updated


Hi Shane, all.

On 30-Jul-08, at 7:32 AM, Shane McCarron wrote:
> As I am sure you are aware, there are updated XHTML Basic 1.1 and  
> W3C Mobile Profile recommendations available.  Associated with (at  
> least) XHTML Basic 1.1 is an updated DTD.  Please add this DTD to  
> the validator's list of explicitly supported markup languages as  
> soon as possible.

Congrats on the REC status for XHTML Basic 1.1!
I updated the catalog, and it should go in production on Friday.

By Friday (if I get enough time without disturbance, and/or if I get  
help), I am planning to:
* install squid (HTTP cache) on the validator servers
* setup squid to *only* cache DTDs, schemas, entities, modules (but  
cache them very aggressively)
* add an option in the validator config to use caching proxy OR catalog
   (the latter will be default option)

If there is any squid expert around here, with an hour or so to spare,  
that would be phenomenal! Please drop me a line.

Thanks.
--

-- 
olivier

olivier Thereaux | 4 Aug 2008 17:13
Picon
Favicon

Re: XHTML Basic updated


On 4-Aug-08, at 10:04 AM, olivier Thereaux wrote:
> * install squid (HTTP cache) on the validator servers
> * setup squid to *only* cache DTDs, schemas, entities, modules (but  
> cache them very aggressively)
> * add an option in the validator config to use caching proxy OR  
> catalog
>  (the latter will be default option)

That was assuming that the two software components likely to fetch  
DTDs or Schemas actually supported the use of a caching proxy. A bit  
more research later, I could not find authoritative info on whether  
libxml2 does, but as far as OpenSP is concerned, the news are not good:
http://sourceforge.net/tracker/index.php?func=detail&aid=1748536&group_id=2115&atid=352115
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=353220

This unfortunately makes the idea of using caching proxies instead of  
catalogs/entity resolvers moot. The (thin, I admit) hope is that  
adding proxy support seems to be on a possible roadmap - at least  
according to this 2003 thread:
http://sourceforge.net/mailarchive/message.php?msg_id=1041881661.1314.8.camel%40kerberos
So maybe if someone wants to give it a shot...

In the meantime, the validator release is still scheduled for Friday,  
but without proxy support.

--

-- 
olivier

olivier Thereaux | 4 Aug 2008 20:36
Picon
Favicon

Re: Problem with validating password-protected pages


Hello,

On 3-Aug-08, at 11:07 AM, H. Hahn wrote:
> While developing a website, I wanted to validate a certain page that  
> is password-protected.

Did you use HTTP level password protection (the validator can proxy  
that kind of authentication) or form-and-session-cookie? The latter,  
obviously, the validator can not handle, and the best way to check  
such pages is to use direct input or file upload.

> As I was logged in at a sufficiently high level, having access to  
> all pages, I tacitly expected the validator to have the same rights  
> as its invoker (i.e., me) had.

Fortunately, no.

> Only after I re-validated with displaying the complete source code,  
> I found that it had not validated the requested page, but the "Page  
> not found" page. Basically, this was correct, as the validator  
> apparently was refused access to the page.

Not sure why the lack of authentication would return a "page not  
found" page. That does not sound right.

> However, both the validator's address field and the validation  
> result text mentioned the correct URL of the original page, without  
> any mention of the "Page not found" page.

That's a problem with your system. The validator correctly displays  
redirected URLs.
e.g see:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.w3.org%2FConsortium%2FLegal%2Fipr-notice
and look at the Address: Field.

Thank you.
--

-- 
olivier

Brian Wilson | 4 Aug 2008 21:17

Re: major web sites (Alexa)


Alright...first, my apologies for the delay on this. Your post was
*only* a month ago now! Took a little time and some wrangling to do this.

Rick Merrill wrote:
>
> Brian wrote:
>>
>> One popularity measure (among many) is Alexa. It has some caveats, but
>> in January I had the validator run through 487 of its Global Top 500
>> list. 32 of those URLs passed validation (6.57%). That is actually
>> considerably higher than the average pass rate I found with the
>> majority of the Open Directory Project URLs (DMoz). I have a complete
>> list of those Alexa 500 that validated, but of the ones you mentioned,
>> only msn.com passed validation.
>
> How about a web page where you Post that complete list - with numbers of
> errors?

Here it is:
http://my.opera.com/operaqa/blog/2008/08/04/alexa-global-top-500-validation-research

Feedback, comments and questions can be made in the blog's comment thread
or here too if they are validator-on-topic.

-Brian

Brian Wilson --------------------------"Those aren't Sex muffins!   -Coach
bloo <at> blooberry.com ---------------------Those aren't Love muffins!
http://www.blooberry.com ---------------Those are just BLOOberry muffins!"
Creator of Index DOT Html/Css: http://www.blooberry.com/indexdot/

Picon
Picon
Favicon

elements hr in a xhtml basic 1.1 document

An xhtml 1.1 basic document with two hr elements "<hr />", is incorrect using the html validator.

But this tag is included in the xhtml 1.1 basic especification.

Thanks.




Enviado desde Correo Yahoo!
La bandeja de entrada más inteligente.
Azu | 5 Aug 2008 23:16
Picon

What is the correct way to do content negotiation?

Hi, if this has been asked before or if this is the wrong place to ask, sorry.



Basically, what I'm wandering is, how am I supposed to do content negotiation? At first I thought that I was supposed to use the HTTP_ACCEPT header, but when I use your validator script at validator.w3.org to try to test my website in different content types (by using the doctype option), it doesn't change anything in the HTTP_ACCEPT header. Where is the information located? Please help.. the requests look exactly the same to me.. =(




P.S. on a completely different topic; how do I change the options in your validator script without it re-downloading my web page? Like for example if I want to enable verbose output, how do I have it do this without it downloading the page from my server again?
Bryan Boone | 6 Aug 2008 02:10
Picon
Favicon

Why isn't the HTML validator available for download

What I would like to know is, why is the CSS validator available for download and use on a non-public network, but the HTML validator is not?
 
thanks

Got Game? Win Prizes in the Windows Live Hotmail Mobile Summer Games Trivia Contest Find out how.

Gmane