[?] XMLDom loading files with <?xml ?> data... - Printable Version

-Shoutbox (
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: [?] XMLDom loading files with <?xml ?> data... (/showthread.php?tid=97796)

[?] XMLDom loading files with <?xml ?> data... by whiz on 06-13-2011 at 10:33 AM

Note: this question relates to using the XMLDom ActiveXObject with an HTML Application, although this effect also occurs with standalone JScript, and I assume with Plus! scripting as well.

I'm trying to load an XML file that looks something like this:

XML code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="1.0">

Trouble is, I can only seem to read the first line (<?xml ... ?>).  Using something like:
Javascript code:
XMLDom.selectSingleNode("//app/" + Node + "/").nodeValue

...where Node is any of the child nodes (name, coder etc.), always seems to return:
version="1.0" encoding="UTF-8" standalone="yes"
Even using //app[@version="1.0"]/ has no effect.  However, the following code works (by returning the app node).
Javascript code:
XMLDom.selectSingleNode("//").nextSibling // but can also select //app/ or anything else

As long as the select function receives something with a // at the start, it fetches the <?xml ?> section.  Why is this?  :S