cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Blake <p...@tcp.net.au>
Subject Re: use-browser-capabilities-db
Date Wed, 16 Jan 2002 00:54:39 GMT
Has anyone had any success getting the browser info? From the messages 
below, I get the impression that it is partially working but no example 
as to how.

I'm going to make a guess based on this thread - can someone who knows 
please correct anything/everything... :)

In sitemap.xmap you must set 'use-browser-capabilities-db' to true as in 
the following example:

             <map:generate src="docs/{1}.xml"/>
             <map:transform type="xslt" src="stylesheets/test.xsl">
                 <map:parameter name="use-request-parameters" 
value="true"/>
                 <map:parameter name="use-browser-capabilities-db" 
value="true"/>
             </map:transform>
             <map:serialize/>

In the xsl doc <?!?>, add a parameter as in the following example from 
Bartomeu Adrover:

	<xsl:param name="browser"/>

Then, apparently, you can refer to the browser param with gay abandon as 
in the following example:

	<xsl:value-of select="$broswer">

Is this right? It doesn't work when I try it.

Would Bartomeu Adrover be able to email some example code as you seem to 
have it working?

Thanks in advance.

Phil

On Tuesday, January 15, 2002, at 11:21 PM, Alex Kachanov wrote:

>
> BrowserImpl.xml - is Cocoon2 browser capability database file - that 
> stores the different
> values of different browsers. Cocoon hashes this file and recognizes 
> the UA by User-Agent
> header. So there is no need to pas any additional parameters in the 
> HTTP request except
> User-agent string (which is a standard header)
>
> This is how I can adapt and prepare the content file before sending it 
> to the client.
>
> This functionality is switched on by setting 
> "use-browser-capabilities-db" to "true"
> in sitemap.xmap
>
> Howevere, only some of the variables declared in BrowserImpl.xml become 
> visible for XSLT,
> and of course not the variables that I need.
>
>
> p.s. I need to forget about javaScript - cellphones do not know what it 
> is.
>
>
>
>
>
> -----Original Message-----
> From: Bartomeu Adrover [mailto:tomeu.adrover@uib.es]
> Sent: 15 ?????? 2002 ?. 21:14
> To: cocoon-users@xml.apache.org
> Subject: Re: use-browser-capabilities-db
>
>
> I don't know what is the BrowserImpl.xml do, but if you want to retrive 
> the browser
> screen size, you must put this value as param value using javascript 
> code and retrieve
> this value as normal parameter in the xslt.
> When you do an http connection you don't pass this value and the server 
> (in our case
> the cocoon) don't know this value.
>
> Alex Kachanov wrote:
>
>> OK
>>
>> I have
>>
>> <browser media="explorer">
>>  <user-agent>MSIE</user-agent>
>>  <screen-width>296</screen-width>
>> </browser>
>>
>> in BrowserImpl.xml
>>
>> How can I get the screen-width variable in XSL?
>>
>> <xsl:param> or <xsl:variable> are not working for this variable
>>
>> -----Original Message-----
>> From: Bartomeu Adrover [mailto:tomeu.adrover@uib.es]
>> Sent: 15 "'"~"r"p","' 2002 "s. 20:16
>> To: cocoon-users@xml.apache.org
>> Subject: Re: use-browser-capabilities-db
>>
>> You can retrieve in a XSLT this values as parameters (with the 
>> <xsl:param> tag):
>> accept
>> user-agent
>> browser
>> browser-media
>>
>> Declare this parmeter in the top of the xslt as simple form parameters
>> <xsl:param name="accept"/>
>>  <xsl:param name="user-agent"/>
>>  <xsl:param name="browser"/>
>>  <xsl:param name="browser-media"/>
>>
>> Alex Kachanov wrote:
>>
>>> This information is not enough to understand how it works for a 
>>> non-Java guru guy
>>>
>>> -----Original Message-----
>>> From: Bartomeu Adrover [mailto:tomeu.adrover@uib.es]
>>> To: cocoon-users@xml.apache.org
>>> Subject: Re: use-browser-capabilities-db
>>>
>>> There are any information about this in the source code of the xslt
>>> transformer.
>>>
>>> Alex Kachanov wrote:
>>>
>>>> There is a parameter in sitemap "use-browser-capabilities-db"
>>>>
>>>> does any one know how to use this parameter?
>>>> The documentation tells about some browser capability database
>>>> but where is it in the filesystem?
>>>>
>>>> with best wishes
>>>> Alexander Kachanov
>>>>
>>>> ---------------------------------------------------------------------
>>>> Please check that your question has not already been answered in the
>>>> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>>>
>>>> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>>>> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>>>
>>> ---------------------------------------------------------------------
>>> Please check that your question has not already been answered in the
>>> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>>
>>> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>>> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>>
>> ---------------------------------------------------------------------
>> Please check that your question has not already been answered in the
>> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>

Mime
View raw message