You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/05/28 12:03:51 UTC

cvs commit: xml-cocoon2/src/org/apache/cocoon/transformation I18nTransformer.java I18nTransformer2.java TraxTransformer.java

cziegeler    01/05/28 03:03:51

  Modified:    src/org/apache/cocoon/environment Source.java
               src/org/apache/cocoon/transformation I18nTransformer.java
                        I18nTransformer2.java TraxTransformer.java
  Log:
  Removed getReader() from source to avoid encoding problems with the reader (reported by Konstantin)
  
  Revision  Changes    Path
  1.3       +1 -15     xml-cocoon2/src/org/apache/cocoon/environment/Source.java
  
  Index: Source.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Source.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Source.java	2001/05/23 14:55:43	1.2
  +++ Source.java	2001/05/28 10:03:47	1.3
  @@ -24,7 +24,7 @@
    * for accessing any resource (URL, local file etc).
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/05/23 14:55:43 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/05/28 10:03:47 $
    */
   
   public final class Source {
  @@ -118,20 +118,6 @@
               if (this.connection == null)
                   this.connection = this.url.openConnection();
               return this.connection.getInputStream();
  -        }
  -    }
  -
  -    /**
  -     * Return an <code>Reader</code> object to read from the source.
  -     */
  -    public Reader getReader()
  -    throws IOException {
  -        if (this.isFile == true) {
  -            return new FileReader(this.systemId.substring(FILE.length()));
  -        } else {
  -            if (this.connection == null)
  -                this.connection = this.url.openConnection();
  -            return new InputStreamReader(this.connection.getInputStream());
           }
       }
   
  
  
  
  1.6       +1 -1      xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer.java
  
  Index: I18nTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- I18nTransformer.java	2001/05/23 14:55:49	1.5
  +++ I18nTransformer.java	2001/05/28 10:03:48	1.6
  @@ -332,7 +332,7 @@
           try
           {
               parser = (Parser)(manager.lookup(Roles.PARSER));
  -            InputSource input = new InputSource(this.inputSource.getReader());;
  +            InputSource input = new InputSource(this.inputSource.getInputStream());
   
               // How this could be cached?
               dictionary = new Hashtable();
  
  
  
  1.6       +1 -1      xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer2.java
  
  Index: I18nTransformer2.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer2.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- I18nTransformer2.java	2001/05/23 15:43:04	1.5
  +++ I18nTransformer2.java	2001/05/28 10:03:49	1.6
  @@ -516,7 +516,7 @@
           try
           {
               parser = (Parser)(manager.lookup(Roles.PARSER));
  -            InputSource input = new InputSource(inputSource.getReader());
  +            InputSource input = new InputSource(inputSource.getInputStream());
   
               // How this could be cached?
               this.dictionary = new HashMap();
  
  
  
  1.9       +3 -3      xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java
  
  Index: TraxTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TraxTransformer.java	2001/05/28 09:22:51	1.8
  +++ TraxTransformer.java	2001/05/28 10:03:49	1.9
  @@ -100,7 +100,7 @@
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.8 2001/05/28 09:22:51 cziegeler Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.9 2001/05/28 10:03:49 cziegeler Exp $
    */
   public class TraxTransformer extends ContentHandlerWrapper
   implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable, URIResolver {
  @@ -146,7 +146,7 @@
           Templates templates = getTemplates();
           if(templates == null) {
               getLogger().debug("Creating new Templates in " + this + " for " + this.inputSource.getSystemId());
  -            InputSource is = new InputSource(this.inputSource.getReader());
  +            InputSource is = new InputSource(this.inputSource.getInputStream());
               is.setSystemId(this.inputSource.getSystemId());
               templates = getTransformerFactory().newTemplates(new SAXSource(is));
               putTemplates (templates);
  @@ -158,7 +158,7 @@
           if(handler == null) {
               /* If there is a problem in getting the handler, try using a brand new Templates object */
               getLogger().debug("Re-creating new Templates in " + this + " for" + this.inputSource.getSystemId());
  -            InputSource is = new InputSource(this.inputSource.getReader());
  +            InputSource is = new InputSource(this.inputSource.getInputStream());
               is.setSystemId(this.inputSource.getSystemId());
               templates = getTransformerFactory().newTemplates(new SAXSource(is));
               putTemplates (templates);
  @@ -258,7 +258,7 @@
                                  + new File(parent.getParentFile(), href).getAbsolutePath());
                   }
               }
  -            return new javax.xml.transform.stream.StreamSource(xslSource.getReader());
  +            return new javax.xml.transform.stream.StreamSource(xslSource.getInputStream());
          } catch (IOException e) {
               throw new javax.xml.transform.TransformerException(e);
          } catch (SAXException e) {
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org