Forum Discussion

Apoorva6's avatar
Apoorva6
Frequent Contributor
9 years ago

Help on Replacing my value in groovy based on pattern recognition, inside xml file

In an XML file stored at C:\Users\IBM_ADMIN\Desktop\EBM\MOCK\HALO_TMP_NEW.xml, I have below attribute. The value 90084825 will be changing and I need a way to replace that with my input value
My input value would be $SANUM which I would get from previous steps and $SANUM value must be replaced with gcpSiteId value. I am handling this via Groovy

<cng:gcpSiteId xmlns:cng="http://cki.cingular.com/CKI/Namespaces/Types/Public/CingularDataModel.xsd">90084825</cng:gcpSiteId>

Note: In groovy script I need a way to consider only gcpSiteId from above as it will be constant name always. For example cng: and its url value can change in different file