Re: Replacing Xml Node values with new Values by JHP
JHP
Mon Sep 18 11:47:56 CDT 2006
This should get you started:
(watch for word wrap)
NB*: This has not been tested
Set objDOM = CreateObject("MSXML2.DOMDocument")
objDOM.Async = False
objDOM.ValidateOnParse = False
objDOM.ResolveExternals = False
objDOM.PreserveWhiteSpace = False
If objDOM.Load("C:\test.xml") Then
objNode = objDOM.DocumentElement
strNotes = objNode.SelectSingleNode("Notes")
strFiles = objNode.SelectSingleNode("Files")
If objDOM.Load("C:\test2.xml") Then
objNode = objDOM.DocumentElement
objNode.SelectSingleNode("Computers").SetAttribute("UpdateAll", "TRUE")
objNode.ReplaceChild(strNotes, objNode.SelectSingleNode("Notes"))
objNode.ReplaceChild(strFiles, objNode.SelectSingleNode("Files"))
objDOM.Save("C:\test3.xml")
End If
End If
Set objDOM = Nothing
"Chacko" <jacobneroth@gmail.com> wrote in message
news:1158581224.451716.26030@m73g2000cwd.googlegroups.com...
> Help needed asap,
> Hi all i want to know whether it is possible to replace values of a
> node or a child node(meaning a value of a tag) of one file to another
> file.Both the files are of XML format and i want to do it with vb
> script...
>
> Eg: <Ip > some value </Ip> this is of the first file
>
> <Ip> another value </Ip> another file.
>