fork(3) download
  1. def xmlString = """<?xml version="1.0" encoding="utf-8"?>
  2. <ledesxmlebilling2.1 xmlns="http://w...content-available-to-author-only...s.org/ledes21.xsd">"""
  3.  
  4.  
  5. def xml = new XmlSlurper().parseText(xmlString)
  6. def invoices = xml.'**'.findAll{it.name() == 'invoice'}
  7. println invoices.collectEntries {inv -> [(inv.inv_id): inv.'**'.findAll{it.name() == 'file_item_nbr'}*.text()] }
Success #stdin #stdout 1.44s 95812KB
stdin
Standard input is empty
stdout
[Invoice 31:[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33], Invoice 32:[50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73]]