fork(10) 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 XmlSlurper(false, false).parseText(xmlString)
  31. println groovy.xml.XmlUtil.serialize(xml.'**'.find{it.name() == 'Insu'}.children())
  32.  
Success #stdin #stdout 1.37s 101776KB
stdin
Standard input is empty
stdout
<?xml version="1.0" encoding="UTF-8"?><Entry>
  <Key>ok</Key>
  <Value>hello</Value>
  <MetData>
    <Key>test</Key>
    <Value>test</Value>
  </MetData>
</Entry>