Dear everyone
This problems are still on.
I try (some tips from
http://shoutbox.menthix.net/showthread.php?tid=56747&page=1)
code :
var msgFile = MsgPlus.ScriptFilesPath+"\\Messages.xml";
function file_exists(file)
{
return new ActiveXObject("Scripting.FileSystemObject").FileExists(file);
}
-----------------------------------------------------------------------------------
and
code :
-----------------------------------------------------------------------------------
function get_file_contents(file)
{
var fileSys = new ActiveXObject("Scripting.FileSystemObject");
var fileH = fileSys.OpenTextFile(file, 1, 0);
var text = fileH.ReadAll();
fileH.close();
return text;
}
-----------------------------------------------------------------------------------
Both function is work fine to load plain text file, but not work to parse XML file. If I change to prepare messages in text file, I still have problems in parser data. Because one message can be either one sentence or more sentences. That maybe a new problem to split messages to array.
Then I try (XML request) next one, even I don't know what are output should be.
// -------------------------------------------------------------------
// XML request
function NewRequest(service)
{
xmlFile = service;
Debug.Trace("Calling: "+xmlFile);
var xml = new ActiveXObject("MSXML2.DOMDocument.4.0");
xml.validateOnParse = false;
xml.async = false;
xml.load(xmlFile);
var resp = xml.documentElement;
return resp;
}
// -------------------------------------------------------------------
But I found an error. They say cannot to create obj from
var xml = new ActiveXObject("MSXML2.DOMDocument.4.0");
Because I am very new in XML, I not sure about XML structure.
I don't know how to parse information out.
Please help me! please give me some basic samples will be very kindness.
Thanks