Kadoh, на WSH:
Скрытый текст
Код:
![Выделить весь код](images/misc/selectcode.png)
Option Explicit
Dim strFile
Dim strCurrCorrespAccValue
Dim strNewCorrespAccValue
Dim objXMLDOMElement
strCurrCorrespAccValue = "30101810600000000758"
strNewCorrespAccValue = "30109810060340000009"
If WScript.Arguments.Count = 1 Then
strFile = WScript.Arguments.Item(0)
If WScript.CreateObject("Scripting.FileSystemObject").FileExists(strFile) Then
With WScript.CreateObject("MSXML2.DOMDocument")
.async = False
If .load(strFile) Then
For Each objXMLDOMElement In .selectNodes("/PacketEPD/ED101/Payee/Bank[@CorrespAcc=""" & strCurrCorrespAccValue & """]")
objXMLDOMElement.setAttribute "CorrespAcc", strNewCorrespAccValue
Next
.save strFile
Else
WScript.Echo "Can't load xml content from [" & strFile & "]."
End If
End With
Else
WScript.Echo "File [" & strFile & "] not found"
End If
Else
WScript.Echo "Usage: " & WScript.ScriptName & " <xml-file>"
End If
WScript.Quit 0
Путь к файлу xml задаётся параметром скрипта (также можно просто перетянуть xml-файл на скрипт в Проводнике).