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

XmlParser trims text between element

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.8.6
    • Fix Version/s: None
    • Component/s: XML Processing
    • Labels:
      None

      Description

      text between elements ending with empty line or white spaces is trimmed. This is the test case that should pass:

      import groovy.xml.*
      def xml = new XmlParser().parseText("<a>x \n\t </a>")
      assert "x \n\t " == xml.text()
      

      Note, that XmlSlurper works fine:

      import groovy.xml.*
      def xml = new XmlSlurper().parseText("<a>x \n\t </a>")
      assert "x \n\t " == xml.text()
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              jakub.neubauer Jakub Neubauer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: