cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/transformer Transformer.java XTTransformer.java XalanTransformer.java
Date Sat, 08 Jan 2000 13:03:46 GMT
stefano     00/01/08 05:03:46

  Modified:    src/org/apache/cocoon/processor/xslt XSLTProcessor.java
               src/org/apache/cocoon/processor/xsp XSPTemplate.java
               src/org/apache/cocoon/transformer Transformer.java
                        XTTransformer.java XalanTransformer.java
  Log:
  added base directories to transformation
  
  Revision  Changes    Path
  1.2       +7 -3      xml-cocoon/src/org/apache/cocoon/processor/xslt/XSLTProcessor.java
  
  Index: XSLTProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xslt/XSLTProcessor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSLTProcessor.java	1999/12/14 23:42:39	1.1
  +++ XSLTProcessor.java	2000/01/08 13:03:45	1.2
  @@ -1,4 +1,4 @@
  -/*-- $Id: XSLTProcessor.java,v 1.1 1999/12/14 23:42:39 stefano Exp $ -- 
  +/*-- $Id: XSLTProcessor.java,v 1.2 2000/01/08 13:03:45 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -70,7 +70,7 @@
    * This class implements an XSLT processor.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.1 $ $Date: 1999/12/14 23:42:39 $
  + * @version $Revision: 1.2 $ $Date: 2000/01/08 13:03:45 $
    */
   
   public class XSLTProcessor implements Actor, Processor, Status, Defaults {
  @@ -91,7 +91,11 @@
           try {
               Document stylesheet = getStylesheet(document, parameters);
               Document result = this.parser.createEmptyDocument();
  -            return transformer.transform(document, stylesheet, result);
  +            
  +            // FIXME: the line below uses null systemIDs because there is no
  +            // clean way to have access to this information. We are waiting for
  +            // the sitemap code to be started before changing these.
  +            return transformer.transform(document, null, stylesheet, null, result);
           } catch (PINotFoundException e) {
               return document;
           }
  
  
  
  1.4       +6 -3      xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPTemplate.java
  
  Index: XSPTemplate.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPTemplate.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XSPTemplate.java	2000/01/03 01:42:50	1.3
  +++ XSPTemplate.java	2000/01/08 13:03:45	1.4
  @@ -1,4 +1,4 @@
  -/*-- $Id: XSPTemplate.java,v 1.3 2000/01/03 01:42:50 stefano Exp $ -- 
  +/*-- $Id: XSPTemplate.java,v 1.4 2000/01/08 13:03:45 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -60,7 +60,7 @@
   
   /**
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version $Revision: 1.3 $ $Date: 2000/01/03 01:42:50 $
  + * @version $Revision: 1.4 $ $Date: 2000/01/08 13:03:45 $
    */
   public class XSPTemplate {
     protected String languageName;
  @@ -109,6 +109,9 @@
   /*
   System.err.println(XSPUtil.toMarkup(this.transformer.transform(document, stylesheet, this.parser.createEmptyDocument())));
   */
  -    return this.transformer.transform(document, stylesheet, this.parser.createEmptyDocument());
  +
  +    // FIXME: we should change these nulls to something meaningful to allow
  +    // the transformers to do includes and imports.
  +    return this.transformer.transform(document, null, stylesheet, null, this.parser.createEmptyDocument());
     }
   }
  
  
  
  1.2       +5 -3      xml-cocoon/src/org/apache/cocoon/transformer/Transformer.java
  
  Index: Transformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformer/Transformer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Transformer.java	1999/12/14 23:41:08	1.1
  +++ Transformer.java	2000/01/08 13:03:45	1.2
  @@ -1,4 +1,4 @@
  -/*-- $Id: Transformer.java,v 1.1 1999/12/14 23:41:08 stefano Exp $ -- 
  +/*-- $Id: Transformer.java,v 1.2 2000/01/08 13:03:45 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -58,7 +58,7 @@
    * This interface is implemented by all XSLT tranformers.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.1 $ $Date: 1999/12/14 23:41:08 $
  + * @version $Revision: 1.2 $ $Date: 2000/01/08 13:03:45 $
    */
   
   public interface Transformer extends Actor {
  @@ -67,6 +67,8 @@
        * Process the DOM tree with the given transformation sheet and
        * uses the result tree to return.
        */
  -    public Document transform(Document document, Document sheet, Document result) throws
Exception;
  +    public Document transform(Document document, String documentBase, 
  +                              Document sheet, String sheetBase, 
  +                              Document result) throws Exception;
   
   }
  
  
  
  1.2       +2 -2      xml-cocoon/src/org/apache/cocoon/transformer/XTTransformer.java
  
  Index: XTTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformer/XTTransformer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XTTransformer.java	1999/12/14 23:41:08	1.1
  +++ XTTransformer.java	2000/01/08 13:03:45	1.2
  @@ -1,4 +1,4 @@
  -/*-- $Id: XTTransformer.java,v 1.1 1999/12/14 23:41:08 stefano Exp $ -- 
  +/*-- $Id: XTTransformer.java,v 1.2 2000/01/08 13:03:45 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -75,7 +75,7 @@
   
   public class XTTransformer extends AbstractActor implements Transformer, Status {
   
  -    public Document transform(Document document, Document sheet, Document result) throws
Exception {
  +    public Document transform(Document document, String documentBase, Document sheet, String
sheetBase, Document result) throws Exception {
           Transform transformer = new XSLTransformEngine().createTransform(sheet);
           transformer.transform(document, result);
           return result;
  
  
  
  1.2       +5 -3      xml-cocoon/src/org/apache/cocoon/transformer/XalanTransformer.java
  
  Index: XalanTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformer/XalanTransformer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XalanTransformer.java	1999/12/14 23:41:08	1.1
  +++ XalanTransformer.java	2000/01/08 13:03:45	1.2
  @@ -1,4 +1,4 @@
  -/*-- $Id: XalanTransformer.java,v 1.1 1999/12/14 23:41:08 stefano Exp $ -- 
  +/*-- $Id: XalanTransformer.java,v 1.2 2000/01/08 13:03:45 stefano Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -69,7 +69,7 @@
    * Xalan XSLT processor.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.1 $ $Date: 1999/12/14 23:41:08 $
  + * @version $Revision: 1.2 $ $Date: 2000/01/08 13:03:45 $
    */
   
   public class XalanTransformer extends AbstractActor implements Transformer, Status {
  @@ -85,9 +85,11 @@
           );
       }
   
  -    public Document transform(Document in, Document sheet, Document out) throws Exception
{
  +    public Document transform(Document in, String inBase, Document sheet, String sheetBase,
Document out) throws Exception {
           XSLTInputSource i = new XSLTInputSource(in);
  +        i.setSystemId(inBase);
           XSLTInputSource s = new XSLTInputSource(sheet);
  +        s.setSystemId(sheetBase);
           XSLTResultTarget o = new XSLTResultTarget(out);
           processor.process(i, s, o);
           return out;
  
  
  

Mime
View raw message