cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Kachanov" <a...@intadev.com>
Subject RE: use-browser-capabilities-db - detailed info
Date Wed, 16 Jan 2002 03:43:41 GMT
OK.
 
Firts to enable "use-browser-capabilities-db"
you have to change
 
<use-request-parameters>true</use-request-parameters>
<use-browser-capabilities-db>true</use-browser-capabilities-db>
 
which are false by default
 
 
after that the browser capabilities database becomes available
in your stylesheets
 
This browser capabilities database is stored deep in the code of
Cocoon.jar package
 
The name of the file is
 
org\apache\cocoon\components\browser\BrowserImpl.class
or
org\apache\cocoon\components\browser\BrowserImpl.java
 
BrowserImpl.java is a file that is created automatically
from two files:
 
BrowserImpl.xml and BrowserImpl.xsl
 
That's it - you need to change BrowserImpl.xml and then compile
BrowserImpl.xml and BrowserImpl.xsl together into BrowserImpl.java
and after that compile BrowserImpl.java into BrowserImpl.class
 
The structure of BrowserImpl.xml is pretty obvious. It was easy to
add new browsers and add new properties of teh browsers such as: 
"screen-width" "screen-height" for certain mobile phones.
 
 
After that you need to restart Cocoon
 
the stylesheet that uses these browser properties will look like this:
 
 
<?xml version="1.0" encoding="Shift_JIS" ?>
<xsl:stylesheet xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" version="1.0">
 
        <xsl:param name="ua-capabilities"/>
        <xsl:variable name="screen-width" select="$ua-capabilities//screen-width"/>
 
         <xsl:template match="/">
            <table width="{$screen-width}" border="1">
                            <tr><td>Blah-blah-blah</td></tr>
                                </table>
         </xsl:template>
</xsl:stylesheet>
 
 
Hope this will help
 
 

-----Original Message-----
From: Phil Blake [mailto:phil@tcp.net.au]
Sent: 16 ÿíâàðÿ 2002 ã. 12:34
To: cocoon-users@xml.apache.org
Cc: Alex Kachanov
Subject: Re: use-browser-capabilities-db



Hi Alex, 


When you say 'cracked' this feature do you mean you have worked out how to use it, or have
lost your mind trying? :) 


If you have worked it out, would you provide a brief explanation and code example on how it
worked? 


Thanks in advance. Have fun, 


Phil 



Mime
View raw message