Hey folks,
I'm trying to sort a script out, to read data from an XML file (Just read... don't think writing is necessary... at least not yet), but I just keep running into problems with it.
I've searched all over the forums, and read the scripting threads which mention XMLDOM, and then tried to frankenstein each of them to work for me, but to no avail.
The error I'm getting is Error: Object required (code: -2146827864). File: XML.js. Line: 5.
My code is this
jscript code:
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.load(MsgPlus.ScriptFilesPath + '\\gameinfo.xml');
var node = xml.selectNodes("game[@name='FIFA06']/title");
var info = node[0].text;
Debug.Trace(info);
And my xml file is
xml code:
<?xml version="1.0">
<gameslist>
<game name="FIFA06">
<title>Road to FIFA World Cup</title>
<psm>Playing soccer</psm>
</game>
<game name="PD">
<title>Perfect Dark Zero</title>
<psm>Killing people</psm>
</game>
</gameslist>
Obviously I intend to add a LOT more to the xml, but thats all I'm using just now. I have also tried using node.text whcih doesnt give an error, but also gives no text, perhaps just a space.
Can anyone see what I've done wrong, or give me any pointers>
Any help is appreciated
Leroux