Thursday, May 27, 2010

Enter values in specified Node in XML file

Enter the data in specified Node in XML file with below code.
Code :-
Set Doc = XMLUtil.CreateXML()
Doc.LoadFile "XmlFilePath"
Set root = doc.GetRootElement()
Set children = root.ChildElements()
For i = 1 to datatable.LocalSheet.GetRowCount
datatable.LocalSheet.SetCurrentRow(i)
Set firstChild = doc.GetRootElement().ChildElementsByPath("Node path through Local sheet").Item(1)
firstChild.setValue "Enter Value"
Next
doc.SaveFile "C:\Test_SaveAs.XML"

No comments:

Post a Comment