Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3265

XmlNodePrinter outputs too much whitespace

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.7, 1.6-rc-1
    • 1.6-rc-2, 1.7-beta-1
    • XML Processing
    • None

    Description

      XmlNodePrinter outputs too much whitespace. The printLineEnd() method is always called after begin tags, and after the text body. If the element test is short this leads to ugly XML, e.g.

            <id>
               foo
            </id>
      

      where

            <id>foo</id>
      

      is more readable and more like what you would write by hand. There could be a rule that all element text values that do not contain whitespace, or that are less than N characters long, would be output in this shorter form.

      Attachments

        Activity

          People

            paulk Paul King
            david_syer Dave Syer
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: