Function Savefile (filename, xmlstr) // Save text file {var FSO, TF, F; fso = new activXObject ("scripting.filesystemObject"); try {f = fso.getfile (filename); f.attributes = 0;} Catch (e) {} tf = fso.createtextfile (filename, true);
Tf.write (Xmlstr); tf.close ();
Function createdom (xmlstr) {var DOM = New ActiveXObject ("msxml2.domdocument.3.0"); // Create a DOM instance, and load file Dom.Assync = "false"; DOM.LoadXML (Xmlstr); return Dom;}
function setValueByName (pTagName, pKeyName, pValue) {var xmlDom = createDom (openFile (GetXmlFilePath ())); var pNodeList = xmlDom.getElementsByTagName (pTagName); var pchildNode = pNodeList.item (0) .firstChild; for (j = 1 ;; j ) {if (pchildNode.nodeName == pKeyName) {pchildNode.text = pValue; break;} pchildNode = pchildNode.nextSibling;} var xmlStr = xmlDom.xml; xmlStr = xmlStr.replace ( "