Contributions
Re: How to update tag value in external xml using groovy script?
Hi Rupert, Yeah ,so I have an inhouse built(java-groovy) application whichgeneratesa SOAP response and I have to feed that response to a proprietory software .But before sending the response to the software I need to update few tag values as per the Excel received from third party. For now I have manually updated the third party Excel column headers with XPATHs of the XML so that I can update the XMLs as per the values in the corresponding row. My main problem is reading the column header and passing its value in place of Envelope.Body.CamCommand.CamAction.tCANOTIFICATIONS.pCASECIDUNDL in the below code String fileContents = new File(FilePath).text def xmlfromFile = new File(FilePath) def Envelope = new XmlSlurper().parseText(xmlfromFile.getText()) Envelope.Body.CamCommand.CamAction.tCANOTIFICATIONS.pCASECIDUNDL = "NewData123" XmlUtil xmlUtil = new XmlUtil() println xmlUtil.serialize(Envelope) xmlUtil.serialize(Envelope, new FileWriter(xmlfromFile)) Thanks, Amitav5.3KViews0likes1CommentRe: How to update tag value in external xml using groovy script?
Hi Rupert, I am also facing a similar problem but the difference is that I am not doing SOAPUI testing but I need to update the SOAPUI response tag values from an excel before forwarding that response to another system ,since my main application is developed in groovy ,I was thinking if this can be done in groovy only. So my excel header are actually XPATHS and the corresponding rows below contain the value. any help would be great.5.3KViews0likes3Comments