cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: Logicsheets, and relative paths
Date Thu, 01 Feb 2001 12:04:57 GMT
Ulrich Mayring <ulim@denic.de> wrote:
>Donald Ball wrote:
> >
> > logicsheets in c1 have access to the full path to the source xml file by
> > declaring a filename parameter:
> >
> > <xsl:param name="filename"/>
> >
> > that might help you out.
>
>Is there any documentation on this and other parameters passed to the
>XSL stylesheet? Recently someone said in a byline Cookies are also
>passed to the stylesheet

Stylesheets are different to logicsheets. Logicsheets don't get the cookies, 
because that wouldn't make any sense - XSP is not designed to recompile for 
every user.

>- is there a specific place in the source code,
>where all these are listed?

src/org/apache/cocoon/processor/xslt/XSLTProcessor.java

    private Hashtable filterParameters(HttpServletRequest request) {
        Hashtable params = new Hashtable();
        Enumeration parameters = request.getParameterNames();

        if (parameters != null) {
            while (parameters.hasMoreElements()) {
                String name = (String) parameters.nextElement();
                if (isValidName (name))
                    params.put (name, request.getParameter (name));
            }
        }

        Cookie[] cookies = request.getCookies ();
        if (cookies != null) {
            for (int i = 0; i < cookies.length; i++) {
                Cookie cookie = cookies [i];
                String name = cookie.getName ();
                if (isValidName (name))
                    params.put ("C_" + name, cookie.getValue ());
            }
        }

        Enumeration headers = request.getHeaderNames ();
        if (headers != null) {
          while (headers.hasMoreElements ()) {
            String name = (String) headers.nextElement ();
            if (isValidName (name))
              params.put ("R_" + name, request.getHeader (name));
          }
        }

        return params;
    }



src/org/apache/cocoon/processor/xsp/XSPProcessor.java

        // Build XSP parameters for logicsheet
        Hashtable logicsheetParameters = new Hashtable();
        logicsheetParameters.put("filename", filename);
        logicsheetParameters.put("language", languageName);
        logicsheetParameters.put("XSP-ENVIRONMENT", Cocoon.version ());
        logicsheetParameters.put("XSP-VERSION", version());





_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Mime
View raw message