Guest markymcc74 Posted September 15, 2008 Share Posted September 15, 2008 Hi,I'm new to AJAX and XML and am having problems parsing data from a PHP and MySQL file that echos some XML.Basically when I use getElementsByTagName("message") it doesn't seem to be able to retrieve this - I'm guessing this because when I alert the lenth of this array it always says 0.However, when I use firstChild.firstChild.nextSibling..etc..nodeValue it works. So there doesn't seem to be anything wrong with the XML itself and I've set a header to Content-Type: text/xml.Sorry if this is too vague, if you need more code or information than this please let me know.Any help would be much appreciated, I've already spent too long scouring the internet for an answer.Many thanks. Link to comment Share on other sites More sharing options...
poorak Posted February 11, 2009 Share Posted February 11, 2009 have you tried using...xmlDoc.documentElement.getElementsByTagName("message")[0].childNodes[0].nodeName;maybe it can help Link to comment Share on other sites More sharing options...
boen_robot Posted February 12, 2009 Share Posted February 12, 2009 If you can present a sample of the echo-ed XML, it would help.I think (and this is just a blind guess) that your echo-ed XML may be using namespaces, in which case getElementsByTagName() won't work, as it can only find elements that are in no namespace. For that, you'd need getElementsByTagNameNS(), but IE doesn't support it.I could be wrong though, so please show such a sample. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.