cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conny Krappatsch <co...@smb-tec.com>
Subject Re: [C1 (and C2?)] global variables in XSP page
Date Wed, 10 Jan 2001 09:59:05 GMT
On Tue, 09 Jan 2001 18:44:54 -0000
"Robin Green" <greenrd@hotmail.com> wrote:
> I've done it myself many times (in C1). I think you just do
> <xsl:template 
>
match="xsp:page/mypagetag"><xsp:logic>blah</xsp:logic><xsl:apply-templates/></xsl:template>
> 
> where mypagetag is your page root element.

Thanks, but that doesn't work. I try the following

<xsl:template match="xsp:page/*">   
    <xsp:logic>
        String aVariable = null;
    </xsp:logic>
    <xsl:copy>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates/>
    </xsl:copy>
</xsl:template>

and aVariable becomes a _member_ of the created XSPPage (which causes the
sync problem).
But I changed your suggestion a little bit, which put the declaration into
populateDocument(). Althoug it still isn't right at the beginning, but
after the creation of the root element, it should work for now:

<xsl:template match="xsp:page/*">   
    <xsl:copy>
        <xsp:logic>
            String aVariable = null;
        </xsp:logic>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates/>
    </xsl:copy>
</xsl:template>

Still I would really like to have a more "syntactical" way, like it is
planed for C2. And I agree with Joerg, though the intention of
<xsp:beforeOutput> was to allow redirects it could be useful for other
purposes.

Nevertheless, thanks for putting me in the right direction,

Conny Krappatsch

-- 
______________________________________________________________________
Conny Krappatsch                              mailto:conny@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com


Mime
View raw message