cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-1909) Cache validity of XSLT stylesheets does not reflect included or imported stylesheets.
Date Thu, 07 Sep 2006 08:42:23 GMT
    [ http://issues.apache.org/jira/browse/COCOON-1909?page=comments#action_12433063 ] 
            
Ard Schrijvers commented on COCOON-1909:
----------------------------------------

The problem is a little more sophisticated then depicted above:

First of all, the TraxTransformer allows you to set a parameter, <check-includes> to
true, to add the validity of imported/included stylesheets. 

>From the TraxTransformer:

// Get a Transformer Handler if we check for includes
        // If we don't check the handler is get during setConsumer()
        try {
            if ( _checkIncludes ) {
                XSLTProcessor.TransformerHandlerAndValidity handlerAndValidity =
                        this.xsltProcessor.getTransformerHandlerAndValidity(this.inputSource,
null);
                this.transformerHandler = handlerAndValidity.getTransfomerHandler();
                this.transformerValidity = handlerAndValidity.getTransfomerValidity();
            } else {
                this.transformerValidity = this.inputSource.getValidity();
            }
        } catch (XSLTProcessorException se) {
            throw new ProcessingException("Unable to get transformer handler for " + this.inputSource.getURI(),
se);
        }

So, the XSLTProcessor (org.apache.excalibur.xml.xslt.XSLTProcessor) returns the validity of
the imported/included stylesheets. Changing one of the imported stylesheets now, will affect
the (cached) pipeline, since one of the validities in the AggregatedValidity is not valid
anymore.

The only problem is, that this check for includes is not done recursively, and only one level
deep.  Then again, this does not seem to be wrong in cocoon, but merely in org.apache.excalibur.xml.xslt.XSLTProcessorImpl.


public TransformerHandlerAndValidity getTransformerHandlerAndValidity( Source stylesheet,
XMLFilter filter )
        throws XSLTProcessorException

must be recursive for each included stylesheet to get this working. Not sure if this is a
little an overkill. Since we are used to work with many included xsl, including other ones,
etc, to have xsls generic, I implemented a monitor for development mode, that simple clears
my DefaultTransientStore cache, to get rid of having to save parent xsls  

Ard



> Cache validity of XSLT stylesheets does not reflect included or imported stylesheets.
> -------------------------------------------------------------------------------------
>
>                 Key: COCOON-1909
>                 URL: http://issues.apache.org/jira/browse/COCOON-1909
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Components: Sitemap
>    Affects Versions: 2.1.9
>            Reporter: Conal Tuohy
>
> XSLT stylesheets which either import or include other stylesheets are cached too aggressively:
if you change an imported or included stylesheet the change does not take effect until you
update the main stylesheet.
> This bug is supposed to have been fixed years ago, but it still doesn't work for us.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message