cziegeler    01/07/17 08:22:20

  Modified:    src/org/apache/cocoon/transformation TraxTransformer.java
  Log:
  Fixed serious bug in the TraxTransformer: The lexical handler was
  never set!
  
  Please check if this new version is working properly, so that
  we don't get any problems for the upcoming beta2.
  
  Revision  Changes    Path
  1.25      +7 -33     
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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- TraxTransformer.java      2001/07/10 18:52:25     1.24
  +++ TraxTransformer.java      2001/07/17 15:22:13     1.25
  @@ -100,13 +100,11 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Davanum Srinivas</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.24 2001/07/10 18:52:25 balld Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.25 2001/07/17 15:22:13 cziegeler Exp $
    */
  -public class TraxTransformer extends ContentHandlerWrapper
  +public class TraxTransformer extends AbstractTransformer
   implements Transformer, Composable, Recyclable, Configurable, Cacheable, 
Disposable, URIResolver {
   
  -    private static final String FILE = "file:";
  -
       /** The store service instance */
       private Store store = null;
   
  @@ -412,9 +410,6 @@
   
       /**
        * Set the <code>XMLConsumer</code> that will receive XML data.
  -     * <br>
  -     * This method will simply call <code>setContentHandler(consumer)</code>
  -     * and <code>setLexicalHandler(consumer)</code>.
        */
       public void setConsumer(XMLConsumer consumer) {
   
  @@ -445,13 +440,15 @@
           }
   
           super.setContentHandler(transformerHandler);
  +        super.setLexicalHandler(transformerHandler);
  +
           if(transformerHandler instanceof Loggable) {
               ((Loggable)transformerHandler).setLogger(getLogger());
           }
           // According to TrAX specs, all TransformerHandlers are LexicalHandlers
  -        this.setLexicalHandler(transformerHandler);
  -
  -        this.setContentHandler(consumer);
  +        SAXResult result = new SAXResult(consumer);
  +        result.setLexicalHandler(consumer);
  +        transformerHandler.setResult(result);
       }
   
       private HashMap getLogicSheetParameters() {
  @@ -547,29 +544,6 @@
           }
   
           return map;
  -    }
  -
  -    /**
  -     * Set the <code>ContentHandler</code> that will receive XML data.
  -     * <br>
  -     * Subclasses may retrieve this <code>ContentHandler</code> instance
  -     * accessing the protected <code>super.contentHandler</code> field.
  -     */
  -    public void setContentHandler(ContentHandler content) {
  -        transformerHandler.setResult(new SAXResult(content));
  -    }
  -
  -    /**
  -     * Set the <code>LexicalHandler</code> that will receive XML data.
  -     * <br>
  -     * Subclasses may retrieve this <code>LexicalHandler</code> instance
  -     * accessing the protected <code>super.lexicalHandler</code> field.
  -     *
  -     * @exception IllegalStateException If the <code>LexicalHandler</code> or
  -     *                                  the <code>XMLConsumer</code> were
  -     *                                  already set.
  -     */
  -    public void setLexicalHandler(LexicalHandler lexical) {
       }
   
       // FIXME (SM): this method may be a hotspot for requests with many
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to