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

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.6
    • 2.1.7, 2.2.0-beta-2
    • XML Processing
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: