You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mm...@locus.apache.org on 2000/09/26 20:30:38 UTC

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

mmidy       00/09/26 11:30:38

  Modified:    java/src/org/apache/xalan/transformer ResultTreeHandler.java
  Log:
  Try to fix problem with text nodes being output on the root
  
  Revision  Changes    Path
  1.9       +14 -0     xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java
  
  Index: ResultTreeHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ResultTreeHandler.java	2000/08/31 17:31:57	1.8
  +++ ResultTreeHandler.java	2000/09/26 18:30:37	1.9
  @@ -491,9 +491,23 @@
         int n = ch.length;
         for(int i = 0; i < n; i++)
         {
  +        // todo: isSpaceChar doesn't seem to be recognizing 0x0A.  (??) -sb
           if(!Character.isSpaceChar(ch[i]))
           {
             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;
  +            
  +          }
             break;
           }
         }