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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment