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 04:03:49 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

---------------------------------------------------------------------
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