回复 16# dea2140
14楼CrLf大神的powershell脚本可以满足你的要求,你可能没测试。
接受CrLf的建议,用xml DOM,纯属练习- @set @n=0;/* & echo off
- set "xml=example-soapui-project.xml"
- for /f "tokens=1*" %%a in (2.txt) do (
- cscript -nologo -e:jscript "%~0" "%xml%" "%%a" "%%b"
- )
- pause & exit/b & rem */
-
- arg = WScript.Arguments;
- xmlDom = new ActiveXObject("MSXML2.DOMDocument");
- xmlDom.load(arg(0));
- ar = xmlDom.getElementsByTagName("con:config");
- for (i=0; i<ar.length; i++) {
- s = ar[i].getAttribute("resourcePath");
- if (s == arg(1)) ar[i].setAttribute("methodName", arg(2));
- }
- xmlDom.save(arg(0));
复制代码
|