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

DOMCategory: text() doesn't get node value if it is a CDATA section

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.6
    • Fix Version/s: 2.1.7, 2.2.0-beta-2
    • Component/s: XML Processing
    • Labels:
      None

      Description

      DOMCategory.test() fetches nothing if data in a node is wrapped in CDATA section.
      E.g.:

          <root>
              <testText>text works</testText>
              <testCDATA><![CDATA[cdata works]]></testCDATA>
          </root>
          ....
          root.testCDATA.text() == ""
      

      It seems adding a check for CDATA_SECTION_NODE type should be sufficient.
      Please find attached test and proposed fix.

        Attachments

        1. CdataBugTest.groovy
          2 kB
          Alexander Semelit

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              bashnesnos Alexander Semelit
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: