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

XmlSlurper GPath: why do children() have no children()?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.1-beta-3
    • XML Processing
    • None

    Description

      def p = new XmlSlurper().parseText("""<root>
      <a><z/><z/></a>
      <b></b>
      <c></c>
      </root>""")
      
      assert 0 == p.'*'.z.size()
      	// *** why not 2? ***
      
      assert p.'*'.'*'.size() == 0
      	// *** why not 2? ***
      
      assert p.'*'.'*'.collect{it.name()} == []
      	// *** why not ["z", "z"]? ***
      

      Attachments

        1. MissingChildrenTest.groovy
          1 kB
          Ben Smith

        Activity

          People

            paulk Paul King
            bpsm Ben Smith
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: