[AWS] XSLT processing with AWS (fwd)
Ronald Dauster
rpd@ronald-dauster.de
Sun, 21 Dec 2003 12:08:43 +0100
(Sorry if this message appeares twice - I was using the wrong mail
account the first time)
Artola Zubillaga, Xabier wrote:
>On Sat, 20 Dec 2003, Pascal Obry wrote:
>
[... ]
>> > If you want to know if the clients know XSL, you should
>> > check the "accept content" header for that information.
>>
>>Indeed, this is certainly a better approach. The header to check
>>is "Accept:". You need 2 steps, first get the header list
>>from the callback status, then get the Accept header, something like:
>>
>> Accept : constant String
>> := Headers.Get_Values (Status.Header (Request), Messages.Accept_Token);
>>
>>Pascal.
>>
>>
>[...]
>
>2) while using
> Aws.Headers.Get_Values (Aws.Status.Header (Request),
> Aws.Messages.Accept_Token)
>
> I get:
>
>image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-
>powerpoint, application/vnd.ms-excel, application/msword,
>application/x-shockwav e-flash, */*
>
> where I can not see whether the browser is able to process XSLT or not.
>I am getting confused now.
>
>Could you make a bit clearer the point? Thanks,
>
>Xabier Artola.
>University of The Basque Country.
>
>
>
Using the accept header will _not_ work, neither in theory, nor in
practise:
1. The "accept" header tells the server about the supported and
preferred document
formats, not abount the supported formats for secondary files. E. g., a
browser does
not include "text/javascript" or "text/css" to indicate Javascript or
CSS-capabilities.
Thus, even if the accept header indicates that the browser supports XML,
either
with "text/xml" or "text/*", that can mean:
- the browser can perform XSLT on the fly and display the result
- the browser can display a DOM-Tree
- the browser can display text files
- the browser can download text files
2. In practise, as you have already figured out yourself, the accept
Header by itself is
pretty much useless. These are the accept headers sent by those
browsers from one
of my computers:
MSIE 6.0:
image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
(this will include application/msword, etc if MS Office has been installed)
Mozilla 1.4:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,
video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Opera 7.03:
text/html, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
I think, the exact type and version of a browser can be detected, but only
if you take _all_ request headers into account and compare them against
a database of known headers. In the example above, both the user-agent and
the accept-encoding header can be used to detect Opera, the pair of
connection and keep-alive headers can be used to distinguish all three
browsers.
Regards,
Ronald