XMLDOM - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: XMLDOM (/showthread.php?tid=86860) XMLDOM by ArkaneArkade on 10-25-2008 at 05:32 AM
Hey folks, jscript code: And my xml file is xml code: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 RE: XMLDOM by Matti on 10-25-2008 at 09:08 AM
jscript code:This would assume that the "game" node is at the root of your document, but it isn't. There are a few ways to do this in the correct way: jscript code:Also, because I think that you don't want two game nodes to have the same name attribute, you can simply avoid using selectNodes and use selectSingleNode instead: jscript code:Hopefully this works for you. RE: XMLDOM by ArkaneArkade on 10-25-2008 at 03:52 PM
Matti, cheers for the help, I've changed to use the single node and it's working now. It didnt at first, and I spent a while stressing, till I reread your reply, and thought of the document level nodes. I've now removed the <?xml version="1.0"> and it works perfectly. RE: XMLDOM by Matti on 10-25-2008 at 06:07 PM
Hmm, that's quite odd. I'd highly recommend you to keep your XML file header. The XML header isn't actually part of the document, it simply tells the parser what it is. Maybe you have to specify the file encoding in the header to make it work properly? xml code: RE: XMLDOM by ArkaneArkade on 10-26-2008 at 12:06 AM
I tried just copying and pasting what you said Matti, but I get back to my same error again. |