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

Add extra DOM manipulation methods to DOMCategory

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 1.7.2, 1.8-beta-1
    • XML Processing
    • None
    • Patch

    Description

      XmlSlurper allows you to add nodes using this syntax:

      def node = new XmlSlurper().parse(...)
      node.'filter' + {
          'filter-name'('shirFilter')
          'filter-class'('...')
      }
      

      I would actually like to replace XmlSlurper in one part of Grails with DOMCategory, so it would be great if DOMCategory supported the same syntax.

      I have attached a patch that implements the above and also adds a replaceNode() method and support for negative and range indices.

      Attachments

        1. DOMCategory-improvements.patch
          11 kB
          Peter Ledbrook

        Activity

          People

            paulk Paul King
            pledbrook Peter Ledbrook
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: