When check-includes for stylesheets is true for caching, it only works for one 
level deep included/imported stylesheets: if you change an imported or included 
stylesheet the change does not take effect until you update the main 
stylesheet. 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: EXLBR-31
                 URL: http://issues.apache.org/jira/browse/EXLBR-31
             Project: Excalibur Components
          Issue Type: Bug
          Components: XMLUtil
    Affects Versions: 1.2
            Reporter: Ard Schrijvers


When using cached stylesheets, and have for example in cocoon in the 
TraxTransformer the check-includes set to true, the includes are only checked 
one level deep. So a change in directly imported/included xsls do affect the 
validity of the main (the very first one) stylesheet, but a change in an 
imported stylesheet of an imported one do need invalidate the main styleheet 
(therefor, you need to touch the main stylesheet all the time when you work 
with many importing styleheets and use them hierarchically). 

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. 

See patch.

Ard Schrijvers


-- 
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to