Groovy
  1. Groovy
  2. GROOVY-5379

XmlParser trims text between element

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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()
      

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development