fork(4) download
  1. def xmlString = """<?xml version="1.0" encoding="UTF-8"?>
  2. <S38:manageRequest xmlns:S38="http://content-available-to-author-only.com/S38" xmlns:header="http://content-available-to-author-only.com/header/" xmlns:xsi="http://w...content-available-to-author-only...3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://content-available-to-author-only.com/xsd/ManageItem XSD/ManageItem.xsd">
  3. <header:standardHeader>
  4. <header:serviceAddressing>
  5. <header:to>
  6. <header:address>http://content-available-to-author-only.com/BLAHBLAH</header:address>
  7. <header:contextItemList>
  8. <header:contextItem contextName="Channel" contextId="http://content-available-to-author-only.com/contextItem">I Need This</header:contextItem>
  9. <header:contextItem contextName="Box" contextId="http://content-available-to-author-only.com/contextItem">Blue</header:contextItem>
  10. </header:contextItemList>
  11. </header:to>
  12. </header:serviceAddressing>
  13. </header:standardHeader>
  14. </S38:manageRequest>"""
  15.  
  16.  
  17. def xml = new XmlSlurper().parseText(xmlString)
  18. def cItemChannel = xml.'**'.find {it.name() == 'contextItem' && it.@contextName == 'Channel'}?.text()
  19. println cItemChannel
Success #stdin #stdout 0.97s 4456448KB
stdin
Standard input is empty
stdout
I Need This