You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by jh...@apache.org on 2006/10/29 17:33:08 UTC
svn commit: r468933 -
/excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/xslt/XSLTProcessorImpl.java
Author: jheymans
Date: Sun Oct 29 08:33:07 2006
New Revision: 468933
URL: http://svn.apache.org/viewvc?view=rev&rev=468933
Log:
fix for EXLBR-31, by Ard Schrijvers
Modified:
excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/xslt/XSLTProcessorImpl.java
Modified: excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/xslt/XSLTProcessorImpl.java
URL: http://svn.apache.org/viewvc/excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/xslt/XSLTProcessorImpl.java?view=diff&rev=468933&r1=468932&r2=468933
==============================================================================
--- excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/xslt/XSLTProcessorImpl.java (original)
+++ excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/xslt/XSLTProcessorImpl.java Sun Oct 29 08:33:07 2006
@@ -127,6 +127,9 @@
/** The ServiceManager */
protected ServiceManager m_manager;
+ /** Hold the System ID of the main/base stylesheet */
+ private String m_id;
+
/**
* Compose. Try to get the store
*
@@ -240,13 +243,13 @@
{
try
{
- final String id = stylesheet.getURI();
- TransformerHandlerAndValidity handlerAndValidity = getTemplates( stylesheet, id );
+ m_id = stylesheet.getURI();
+ TransformerHandlerAndValidity handlerAndValidity = getTemplates( stylesheet, m_id );
if( null == handlerAndValidity )
{
if( getLogger().isDebugEnabled() )
{
- getLogger().debug( "Creating new Templates for " + id );
+ getLogger().debug( "Creating new Templates for " + m_id );
}
// Create a Templates ContentHandler to handle parsing of the
@@ -256,7 +259,7 @@
// Set the system ID for the template handler since some
// TrAX implementations (XSLTC) rely on this in order to obtain
// a meaningful identifier for the Templates instances.
- templatesHandler.setSystemId( id );
+ templatesHandler.setSystemId( m_id );
if( filter != null )
{
filter.setContentHandler( templatesHandler );
@@ -272,9 +275,12 @@
SourceValidity validity = stylesheet.getValidity();
if( validity != null && m_checkIncludes)
{
- m_includesMap.put( id, new ArrayList() );
+ m_includesMap.put( m_id, new ArrayList() );
}
-
+
+
+// from here must go recursive!!
+
try
{
// Process the stylesheet.
@@ -292,7 +298,7 @@
+ stylesheet.getURI() );
}
- putTemplates( template, stylesheet, id );
+ putTemplates( template, stylesheet, m_id );
// Create transformer handler
final TransformerHandler handler = m_factory.newTransformerHandler( template );
@@ -301,9 +307,13 @@
// Create aggregated validity
AggregatedValidity aggregated = null;
+
+
+
if( validity != null && m_checkIncludes)
+
{
- List includes = (List)m_includesMap.get( id );
+ List includes = (List)m_includesMap.get( m_id );
if( includes != null )
{
aggregated = new AggregatedValidity();
@@ -321,14 +331,14 @@
}
finally
{
- if ( m_checkIncludes ) m_includesMap.remove( id );
+ if ( m_checkIncludes ) m_includesMap.remove( m_id );
}
}
else
{
if( getLogger().isDebugEnabled() )
{
- getLogger().debug( "Reusing Templates for " + id );
+ getLogger().debug( "Reusing Templates for " + m_id );
}
}
@@ -659,7 +669,6 @@
getLogger().debug( "resolve(href = " + href +
", base = " + base + "); resolver = " + m_resolver );
}
-
Source xslSource = null;
try
{
@@ -708,7 +717,8 @@
if ( m_checkIncludes ) {
// Populate included validities
- List includes = (List)m_includesMap.get( base );
+ List includes = (List)m_includesMap.get( m_id );
+
if( includes != null )
{
SourceValidity included = xslSource.getValidity();
@@ -719,7 +729,7 @@
else
{
// One of the included stylesheets is not cacheable
- m_includesMap.remove( base );
+ m_includesMap.remove( m_id );
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org