Here's an Antidote diff that cleans up handling of multiline comment blocks
where each line is an individual comment (such as used within Antidote's
own build.xml file). Antidote currently inserts an extra newline between
each complete XML comment. This changes that behavior at the level
of a block comment just below the <project> level in the tree.

--
Jack J. Woehr      # You measure democracy by the freedom it
Senior Consultant  # gives its dissidents, not the freedom
Purematrix, Inc.   # it gives its assimilated conformists.
www.purematrix.com #         - Abbie Hoffman


Index: org/apache/tools/ant/gui/xml/XMLWriter.java
===================================================================
RCS file: 
/home/cvspublic/ant-antidote/src/java/org/apache/tools/ant/gui/xml/XMLWriter.java,v
retrieving revision 1.4
diff -c -r1.4 XMLWriter.java
*** org/apache/tools/ant/gui/xml/XMLWriter.java 28 Sep 2003 13:03:00 -0000      
1.4
--- org/apache/tools/ant/gui/xml/XMLWriter.java 5 Oct 2003 01:25:37 -0000
***************
*** 593,600 ****
                              String qName, Attributes atts)
        throws SAXException
      {
!       elementLevel++;
!       nsSupport.pushContext();
        write('<');
        writeName(uri, localName, qName, true);
        writeAttributes(atts);
--- 593,600 ----
                              String qName, Attributes atts)
        throws SAXException
      {
!         elementLevel++;
!         nsSupport.pushContext();
        write('<');
        writeName(uri, localName, qName, true);
        writeAttributes(atts);
***************
*** 631,644 ****
        write("</");
        writeName(uri, localName, qName, true);
        write('>');
!       if (elementLevel == 1) {
              writeln();
        }
        super.endElement(uri, localName, qName);
        nsSupport.popContext();
!       elementLevel--;
      }
-     
  
      /**
       * Write character data.
--- 631,648 ----
        write("</");
        writeName(uri, localName, qName, true);
        write('>');
! 
!         if (elementLevel == 1) {
              writeln();
        }
+         
        super.endElement(uri, localName, qName);
        nsSupport.popContext();
! 
!         if (--elementLevel == 1) {
!             writeln();
!       }
      }
  
      /**
       * Write character data.
***************
*** 712,718 ****
      public void comment (String data)
        throws SAXException
      {
-         writeln();
          doIndent();
        write("<!--");
        write(data);
--- 716,721 ----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to