You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2000/09/27 07:58:50 UTC

Re: XalanJ2 XMLSerializer problems [2 of 3]

Scott, Myriam et al

Please see my message [1 of 3] for an explanation of these diffs. 
Please review them and let me know what you think.

Gary

cvs diff ResultTreeHandler.java (in directory
D:\Xalan-dev\xml-xalan\java\src\org\apache\xalan\transformer\)
Index: ResultTreeHandler.java
===================================================================
RCS file:
/home/cvspublic/xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java,v
retrieving revision 1.9
diff -r1.9 ResultTreeHandler.java
321c321
<           SerializerFactory factory =
SerializerFactory.getSerializerFactory(Method.HTML);
---
>           // SerializerFactory factory = SerializerFactory.getSerializerFactory(Method.HTML);
329,330c329,336
<     // System.out.println("m_mustFlushStartDoc:
"+m_mustFlushStartDoc);
<     if(m_pendingStartDoc && m_mustFlushStartDoc)
---
>     // System.out.println("m_haveDocContent: "+m_haveDocContent);
>     if (!m_foundStartDoc && m_haveDocContent)
>     {
>       startDocument();
>       m_haveDocContent = true;
>     }
> 
>     if (m_pendingStartDoc && m_haveDocContent)
333d338
<       
339c344,345
<     if((null != m_pendingElementName) && m_mustFlushStartDoc)
---
> //    if((null != m_pendingElementName) && m_haveDocContent)
>     if (null != m_pendingElementName)
356c362,363
<       
---
> 
>       /*      
367c374
<       }
---
>       } */
393a401,403
>   /**
>    * Flag to indicate whether or not our startDocument() method has been called.
>    */
408c418
<     m_mustFlushStartDoc = false;
---
>     m_haveDocContent = false;
427c437
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
446c456
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
463c473
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
489c499
<     if(!m_mustFlushStartDoc)
---
>     if(!m_haveDocContent)
497,510c507
<           m_mustFlushStartDoc = true;
<           if(!m_foundStartDoc)
<           {
<             // Then we have a strange case, where non-whitespace text 
<             // is being output before an element.  While this might be 
<             // considered illegal, let's try and be nice and make the 
<             // xml decl be flushed.
<             // (experemental... these same sort of changes will need
to be
<             // made to the charactersRaw function, etc.  See Myriam's
note to 
<             // Gary Peskin on 9/26/2000.. the right way to fix this is 
<             // probably to supress the xml decl).
<             m_pendingStartDoc = true;
<             
<           }
---
>           m_haveDocContent = true;
515c512
<     if(m_mustFlushStartDoc)
---
>     if(m_haveDocContent)
554c551
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
586c583
<     if(m_mustFlushStartDoc)
---
>     if(m_haveDocContent)
602c599
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
615c612
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
631c628
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
648c645
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
665c662
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
678c675
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
793c790
<     m_mustFlushStartDoc = true;
---
>     m_haveDocContent = true;
1088c1085,1089
<   private boolean m_mustFlushStartDoc = false;
---
>   /**
>    * Flag to indicate that we have some document content since the last
>    * call to startDocument()
>    */
>   private boolean m_haveDocContent = false;
1137c1138
<    * Flag to tell if a StartDocument event is pending.
---
>    * Flag to tell if a call to getContentHandler().startDocument is pending.