You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mi...@apache.org on 2004/02/18 23:32:08 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/transformer TransformerImpl.java TransformerIdentityImpl.java

minchau     2004/02/18 14:32:08

  Modified:    java/src/org/apache/xalan/transformer TransformerImpl.java
                        TransformerIdentityImpl.java
  Log:
  PR: bugzilla 23591
  Submitted by:	Brian Minchau
  Reviewed by:	Henry Zongaro
  
  JAXP transformer.setOutputProperties(null); now not only doesn't
  get an exception, it also resets the internal state to flush out any
  previously accumulated properties as if the transformer had
  just been created.
  - Brian Minchau
  
  Revision  Changes    Path
  1.157     +10 -9     xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
  
  Index: TransformerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
  retrieving revision 1.156
  retrieving revision 1.157
  diff -u -r1.156 -r1.157
  --- TransformerImpl.java	16 Feb 2004 20:41:29 -0000	1.156
  +++ TransformerImpl.java	18 Feb 2004 22:32:08 -0000	1.157
  @@ -930,17 +930,18 @@
             m_outputFormat = new OutputProperties(method);
           else if(m_outputFormat==null)
             m_outputFormat = new OutputProperties();
  -      }
   
  -      if (null != oformat)
  -      {
           m_outputFormat.copyFrom(oformat);
  +        // copyFrom does not set properties that have been already set, so 
  +        // this must be called after, which is a bit in the reverse from 
  +        // what one might think.
  +        m_outputFormat.copyFrom(m_stylesheetRoot.getOutputProperties());
  +      }
  +      else {
  +        // if oformat is null JAXP says that any props previously set are removed
  +        // and we are to revert back to those in the templates object (i.e. Stylesheet).
  +        m_outputFormat = null;
         }
  -
  -      // copyFrom does not set properties that have been already set, so 
  -      // this must be called after, which is a bit in the reverse from 
  -      // what one might think.
  -      m_outputFormat.copyFrom(m_stylesheetRoot.getOutputProperties());
       }
     }
   
  
  
  
  1.30      +6 -4      xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java
  
  Index: TransformerIdentityImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TransformerIdentityImpl.java	16 Feb 2004 20:41:29 -0000	1.29
  +++ TransformerIdentityImpl.java	18 Feb 2004 22:32:08 -0000	1.30
  @@ -604,11 +604,13 @@
           m_outputFormat = new OutputProperties(method);
         else
           m_outputFormat = new OutputProperties();
  -    }
   
  -    if (null != oformat)
  -    {
         m_outputFormat.copyFrom(oformat);
  +    }
  +    else {
  +      // if oformat is null JAXP says that any props previously set are removed
  +      // and we are to revert back to those in the templates object (i.e. Stylesheet).
  +      m_outputFormat = null;
       }
     }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org