cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r220254 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/TraxTransformer.java
Date Fri, 22 Jul 2005 07:14:17 GMT
Author: bdelacretaz
Date: Fri Jul 22 00:14:14 2005
New Revision: 220254

URL: http://svn.apache.org/viewcvs?rev=220254&view=rev
Log:
default-src parameter added, used by the xsltal block

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/TraxTransformer.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/TraxTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/TraxTransformer.java?rev=220254&r1=220253&r2=220254&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/TraxTransformer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/TraxTransformer.java
Fri Jul 22 00:14:14 2005
@@ -187,6 +187,9 @@
     /** The source resolver */
     private SourceResolver resolver;
 
+    /** Default source, used to create specialized transformers by configuration */
+    private String defaultSrc;
+
     /** The XSLTProcessor */
     private XSLTProcessor xsltProcessor;
 
@@ -230,7 +233,12 @@
         
         child = conf.getChild("check-includes");
         this.checkIncludes = child.getValueAsBoolean(this.checkIncludes);
-        
+
+        child = conf.getChild("default-src",false);
+        if(child!=null) {
+            this.defaultSrc = child.getValue();
+        }
+
         if (getLogger().isDebugEnabled()) {
             getLogger().debug("Use parameters is " + this.useParameters);
             getLogger().debug("Use cookies is " + this.useCookies);
@@ -242,6 +250,7 @@
             } else {
                 getLogger().debug("Use default TrAX Transformer Factory.");
             }
+            getLogger().debug("Default source = " + this.defaultSrc);
         }
 
         try {
@@ -279,6 +288,13 @@
      */
     public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
     throws SAXException, ProcessingException, IOException {
+
+        if(src==null && defaultSrc!=null) {
+            if(getLogger().isDebugEnabled()) {
+                getLogger().debug("src is null, using default source " + defaultSrc);
+            }
+            src = defaultSrc;
+        }
 
         if (src == null) {
             throw new ProcessingException("Stylesheet URI can't be null");



Mime
View raw message