Forum Discussion

babusr01's avatar
8 years ago

how to get node values using Xml Parser

Hi , Team    I am trying to read the node values , but getting empty values.   From my SOAP service response i need to read node values.   I got list nodes and each node i need get the values ...
  • babusr01's avatar
    8 years ago BM.children().find( { == "A"})?.text();

  • nmrao's avatar
    8 years ago

    Even more elegant and precise one would be:


    //Closure to show the BM node details
    def showBM = { BM, index -> "Detail of BM node ${index}"
    //Print of log - either one
    //BM.children().each { println "${} : $it" } BM.children().each { "${} : $it" } }

    Of course, rest of the script is same.