donaldp 2002/07/10 02:36:54
Modified: xmlutil/src/java/org/apache/avalon/excalibur/xml/xslt
XSLTProcessorImpl.java
Log:
Aquire store during compose method but only use it if correct flag is set
Revision Changes Path
1.12 +20 -18
jakarta-avalon-excalibur/xmlutil/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessorImpl.java
Index: XSLTProcessorImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/xmlutil/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessorImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XSLTProcessorImpl.java 10 Jul 2002 09:27:50 -0000 1.11
+++ XSLTProcessorImpl.java 10 Jul 2002 09:36:54 -0000 1.12
@@ -109,6 +109,11 @@
m_xmlizer = (XMLizer)manager.lookup( XMLizer.ROLE );
m_errorHandler = new TraxErrorHandler( getLogger() );
m_resolver = (SourceResolver)manager.lookup( SourceResolver.ROLE );
+
+ if( manager.hasComponent( Store.TRANSIENT_STORE ) )
+ {
+ m_store = (Store)manager.lookup( Store.TRANSIENT_STORE );
+ }
}
/**
@@ -136,19 +141,16 @@
m_useStore = params.getParameterAsBoolean( "use-store", this.m_useStore );
m_incrementalProcessing = params.getParameterAsBoolean(
"incremental-processing", this.m_incrementalProcessing );
m_factory = getTransformerFactory( params.getParameter(
"transformer-factory", null ) );
- if( m_useStore )
+ if( !m_useStore )
{
- try
- {
- m_store = (Store)m_manager.lookup( Store.TRANSIENT_STORE );
- }
- catch( final ComponentException ce )
- {
- final String message =
- "XSLTProcessor: use-store is set to true, " +
- "but the lookup of the Store failed.";
- throw new ParameterException( message, ce );
- }
+ m_store = null;
+ }
+ else if( null == m_store )
+ {
+ final String message =
+ "XSLTProcessor: use-store is set to true, " +
+ "but unable to aquire the Store.";
+ throw new ParameterException( message );
}
}
@@ -296,10 +298,10 @@
}
else
{
- final InputStream inputStream = source.getInputStream();
- final String mimeType = source.getMimeType();
- final String systemId = source.getSystemId();
- m_xmlizer.toSAX( inputStream, mimeType, systemId, handler );
+ final InputStream inputStream = source.getInputStream();
+ final String mimeType = source.getMimeType();
+ final String systemId = source.getSystemId();
+ m_xmlizer.toSAX( inputStream, mimeType, systemId, handler );
}
}
@@ -594,7 +596,7 @@
else
{
xslSource = m_resolver.resolveURI( base.substring( 0,
lastPathElementPos )
- + "/" + href );
+ + "/" + href );
}
}
else
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>