You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Conal Tuohy (JIRA)" <ji...@apache.org> on 2006/09/06 01:32:22 UTC

[jira] Created: (COCOON-1909) Cache validity of XSLT stylesheets does not reflect included or imported stylesheets.

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

        

[jira] Commented: (COCOON-1909) Cache validity of XSLT stylesheets does not reflect included or imported stylesheets.

Posted by "Ard Schrijvers (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] Commented: (COCOON-1909) Cache validity of XSLT stylesheets does not reflect included or imported stylesheets.

Posted by "Ard Schrijvers (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1909?page=comments#action_12441677 ] 
            
Ard Schrijvers commented on COCOON-1909:
----------------------------------------

The bug is in XSLTProcessorImpl in public javax.xml.transform.Source resolve( String href, String base ), at List includes = (List)m_includesMap.get( base );. The problem lies in the "base", because the base is related to the stylesheet "calling" the import, so, if it is an import calling an import, the "base" is different from the main stylesheet, therefor not adding its validity to the main stylesheet aggregated validity.

I added a global "m_id" of the main stylesheet that is now used in XSLTProcessorImpl, and replace "base" in List includes = (List)m_includesMap.get( base ) by List includes = (List)m_includesMap.get( m_id );. This solves the invalidation of main stylesheets.

The bug is solved when a new xmlutil jar is included in cocoon

> 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