You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Benjamin Dixon <be...@arches.uga.edu> on 2001/01/03 22:49:58 UTC
XSL Caching trouble
Happy New Year all,
I'm having some trouble with (what I think) is an XSL caching problem
under cocoon 1.8. I have an XSL file that I initially wrote as the output
of an XSP. The way the system works is, the XSP draws data from the
database and then passes the data to a stylesheet that determines what
format (one stylesheet for each format) the user wants the output in, then
another stylesheet, for example an HTML stylesheet or a PDF stylesheet,
formats the final output. The problem is, I can change the middle
stylesheet (that selects the proper format) but I'm not able to see any
changes in the third stylesheet(s) (that formats the final output). I can
change the html stylesheet but the changes will not be reflected in the
output so my guess is that somewhere along the line, the stylesheet has
been cached and the cocoon website seems to confirm that XSL stylesheets
are cached. Further, I went through the mail archives looking for answers
and came across a comment that Xalan does some caching of its own. So I
thought I might just be able to shutdown and restart JServ but no such
luck, that page still looks the same (though the file on which it is based
has changed). I also thought I might try the hasChanged method but that
had not effect either. What other areas might be the problem? Or, better
yet, what is the solution? :> I can't continue working on it until I
figure this out because I can't see the effect my changes have! So any
information is appreciated. To make my problem clear, I've included some
code and diagrams below. I hope they display correctly on your end.
The Process:
------------
/HTML Stylesheet
XSP -> Style StyleSheet -WML Stylesheet
\etc
The code:
---------
This is the stylesheet selector code (based on work someone else sent to
the list. Thanks whoever you are!)
<!-- extraneous stuff //-->
<xsl:param name="format"/>
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$format = 'details'">
<xsl:processing-instruction name="cocoon-process"> type="xslt"
</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/details-html.xsl"
type="text/xsl"</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/details-wml.xsl" type="text/xsl"
media="wap"</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/details-palm.xsl" type="text/xsl"
media="palm"</xsl:processing-instruction>
</xsl:when>
<xsl:when test="$format = 'pdf'">
<xsl:processing-instruction name="cocoon-process"> type="xslt"
</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/test/test-search-pdf.xsl"
type="text/xsl"</xsl:processing-instruction>
</xsl:when>
<xsl:when test="$format = 'xml'">
<xsl:processing-instruction name="cocoon-process"> type="xslt"
</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/search-xml.xsl"
type="text/xsl"</xsl:processing-instruction>
</xsl:when>
<xsl:otherwise>
<xsl:processing-instruction name="cocoon-process"> type="xslt"
</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/search-html.xsl" type="text/xsl"
</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/search-wml.xsl" type="text/xsl"
media="wap"</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">
href="stylesheets/search-palm.xsl" type="text/xsl"
media="palm"</xsl:processing-instruction>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="@*|*|text">
<xsl:copy-of select="."/>
</xsl:template>
<!-- more extraneous stuff //-->
The selected stylesheet is nothing special, just a generic HTML
stylesheet. I know it works, I just don't understand why its cached.
And the XSP is nothing special either.
Ben
Re: XSL Caching trouble
Posted by Piyush Sheth <pi...@imagine-sw.com>.
That's a known bug in cocoon-1.8.
solution
if you edit stylesheet then you should also "touch" your XSP file to see
changes made by formatting stylesheet.
Piyush.
----- Original Message -----
From: Benjamin Dixon <be...@arches.uga.edu>
To: <co...@xml.apache.org>
Sent: Wednesday, January 03, 2001 4:49 PM
Subject: XSL Caching trouble
>
> Happy New Year all,
>
> I'm having some trouble with (what I think) is an XSL caching problem
> under cocoon 1.8. I have an XSL file that I initially wrote as the output
> of an XSP. The way the system works is, the XSP draws data from the
> database and then passes the data to a stylesheet that determines what
> format (one stylesheet for each format) the user wants the output in, then
> another stylesheet, for example an HTML stylesheet or a PDF stylesheet,
> formats the final output. The problem is, I can change the middle
> stylesheet (that selects the proper format) but I'm not able to see any
> changes in the third stylesheet(s) (that formats the final output). I can
> change the html stylesheet but the changes will not be reflected in the
> output so my guess is that somewhere along the line, the stylesheet has
> been cached and the cocoon website seems to confirm that XSL stylesheets
> are cached. Further, I went through the mail archives looking for answers
> and came across a comment that Xalan does some caching of its own. So I
> thought I might just be able to shutdown and restart JServ but no such
> luck, that page still looks the same (though the file on which it is based
> has changed). I also thought I might try the hasChanged method but that
> had not effect either. What other areas might be the problem? Or, better
> yet, what is the solution? :> I can't continue working on it until I
> figure this out because I can't see the effect my changes have! So any
> information is appreciated. To make my problem clear, I've included some
> code and diagrams below. I hope they display correctly on your end.
>
> The Process:
> ------------
>
> /HTML Stylesheet
> XSP -> Style StyleSheet -WML Stylesheet
> \etc
>
> The code:
> ---------
>
> This is the stylesheet selector code (based on work someone else sent to
> the list. Thanks whoever you are!)
>
> <!-- extraneous stuff file://-->
> <xsl:param name="format"/>
>
> <xsl:template match="/">
> <xsl:choose>
> <xsl:when test="$format = 'details'">
> <xsl:processing-instruction name="cocoon-process"> type="xslt"
> </xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/details-html.xsl"
> type="text/xsl"</xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/details-wml.xsl" type="text/xsl"
> media="wap"</xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/details-palm.xsl" type="text/xsl"
> media="palm"</xsl:processing-instruction>
> </xsl:when>
> <xsl:when test="$format = 'pdf'">
> <xsl:processing-instruction name="cocoon-process"> type="xslt"
> </xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/test/test-search-pdf.xsl"
> type="text/xsl"</xsl:processing-instruction>
> </xsl:when>
> <xsl:when test="$format = 'xml'">
> <xsl:processing-instruction name="cocoon-process"> type="xslt"
> </xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/search-xml.xsl"
> type="text/xsl"</xsl:processing-instruction>
> </xsl:when>
> <xsl:otherwise>
> <xsl:processing-instruction name="cocoon-process"> type="xslt"
> </xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/search-html.xsl" type="text/xsl"
> </xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/search-wml.xsl" type="text/xsl"
> media="wap"</xsl:processing-instruction>
> <xsl:processing-instruction name="xml-stylesheet">
> href="stylesheets/search-palm.xsl" type="text/xsl"
> media="palm"</xsl:processing-instruction>
> </xsl:otherwise>
> </xsl:choose>
> <xsl:apply-templates/>
> </xsl:template>
> <xsl:template match="@*|*|text">
> <xsl:copy-of select="."/>
> </xsl:template>
> <!-- more extraneous stuff file://-->
>
> The selected stylesheet is nothing special, just a generic HTML
> stylesheet. I know it works, I just don't understand why its cached.
>
> And the XSP is nothing special either.
>
> Ben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>