Jump to content

responseXML getElementsByTagName


Guest markymcc74

Recommended Posts

Guest markymcc74

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

  • 4 months later...

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...