fork(5) download
  1. def xmlString = """<s:Envelope xmlns:s="http://s...content-available-to-author-only...p.org/soap/envelope/">
  2. <s:Body>
  3. <Qres xmlns="http://w...content-available-to-author-only...t.com/h/xsd">
  4. <PMR xmlns:xsd="http://w...content-available-to-author-only...t.com/h/xsd">
  5. <ID xmlns="http://e...content-available-to-author-only...e.services/Results.xsd" xmlns:ns1="urn:Group/20160505/Ons" xmlns:xsi="http://w...content-available-to-author-only...3.org/2001/XMLSchema-instance">1159</ID>
  6. <ref xmlns="http://e...content-available-to-author-only...e.services/Results.xsd" xmlns:ns1="urn:Group/20160505/Ons" xmlns:xsi="http://w...content-available-to-author-only...3.org/2001/XMLSchema-instance">12345</ref>
  7. <SingleQres xmlns="http://e...content-available-to-author-only...e.services/Results.xsd" xmlns:ns1="urn:Group/20160505/AddOns" xmlns:xsi="http://w...content-available-to-author-only...3.org/2001/XMLSchema-instance">
  8. <Qres>
  9. <ref>12345</ref>
  10. <SC>ok</SC>
  11. <Sche>
  12. <csc>Car</csc>
  13. <Insu>
  14. <Entry>
  15. <Key>ok</Key>
  16. <Value>hello</Value>
  17. <MetData>
  18. <Key>test</Key>
  19. <Value>test</Value>
  20. </MetData>
  21. </Entry>
  22. </Insu>
  23. </Sche>
  24. </Qres>
  25. </SingleQres>
  26. </PMR>
  27. </Qres>
  28. </s:Body>
  29. </s:Envelope>"""
  30. def xml = new XmlParser(false, false).parseText(xmlString)
  31. def entry = xml.'**'.find{it.name() == 'Entry'}
  32. def sw = new StringWriter()
  33. new XmlNodePrinter(new PrintWriter(sw)).print(entry)
  34. println sw.toString()
  35.  
Success #stdin #stdout 1s 4456448KB
stdin
Standard input is empty
stdout
<Entry>
  <Key>
    ok
  </Key>
  <Value>
    hello
  </Value>
  <MetData>
    <Key>
      test
    </Key>
    <Value>
      test
    </Value>
  </MetData>
</Entry>