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

MarkupBuilder fails to escape entities in multi-line attributes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-6
    • Fix Version/s: 1.1-beta-3
    • Component/s: XML Processing
    • Labels:
      None
    • Environment:
      Fedora core 3, JDK 1.5

      Description

      A single-line string used as an attribute is escaped by MarkupBuilder; a multi-line string isn't.

      For example:
      import groovy.xml.*
      MarkupBuilder builder = new MarkupBuilder()
      builder.test
      {
      def multi = '''
      Jon & Co
      '''
      def single = 'Jon & Co'
      inner (multi:multi, single:single)
      }

      produces:

      <test>
      <inner multi='
      Jon & Co
      ' single='Jon & Co' />
      </test>

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              jskeet Jon Skeet
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: