huber 02/04/20 15:41:57
Modified: src/java/org/apache/cocoon/transformation
TraxTransformer.java
Log:
Override transfomer-factory of XSLTProcessor only if
transformer-factory config is explictly specified
Revision Changes Path
1.24 +13 -6
xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java
Index: TraxTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- TraxTransformer.java 20 Apr 2002 00:04:17 -0000 1.23
+++ TraxTransformer.java 20 Apr 2002 22:41:57 -0000 1.24
@@ -157,7 +157,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Ovidiu Predescu</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Mark H. Butler</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Id: TraxTransformer.java,v 1.23 2002/04/20 00:04:17 vgritsenko Exp
$
+ * @version CVS $Id: TraxTransformer.java,v 1.24 2002/04/20 22:41:57 huber Exp $
*/
public class TraxTransformer extends AbstractTransformer
implements Transformer, Composable, Configurable, Cacheable, Disposable {
@@ -230,23 +230,30 @@
this._useSessionInfo = this.useSessionInfo;
child = conf.getChild("transformer-factory");
- this.traxFactory = child.getValue(XSLTProcessor.DEFAULT_FACTORY);
+ // traxFactory is null, if transformer-factory config is unspecified
+ this.traxFactory = child.getValue(null);
+
if (this.getLogger().isDebugEnabled()) {
this.getLogger().debug("Use parameters is " + this.useParameters +
" for " + this);
this.getLogger().debug("Use cookies is " + this.useCookies + " for
" + this);
this.getLogger().debug("Use browser capabilities is " +
this.useBrowserCap + " for " + this);
this.getLogger().debug("Use session info is " + this.useSessionInfo
+ " for " + this);
- if (this.traxFactory == XSLTProcessor.DEFAULT_FACTORY) {
- this.getLogger().debug("Use default TrAX Transformer Factory.");
- } else {
+
+ if (this.traxFactory != null) {
this.getLogger().debug("Use TrAX Transformer Factory " +
this.traxFactory);
+ } else {
+ this.getLogger().debug("Use default TrAX Transformer Factory.");
}
}
try {
this.xsltProcessor = (XSLTProcessor)
this.manager.lookup(XSLTProcessor.ROLE);
- this.xsltProcessor.setTransformerFactory(this.traxFactory);
+ // override xsltProcessor setting only, in case of
+ // transformer-factory config is specified
+ if (this.traxFactory != null) {
+ this.xsltProcessor.setTransformerFactory(this.traxFactory);
+ }
} catch (ComponentException e) {
throw new ConfigurationException("Cannot load XSLT processor", e);
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]