Skip to main content
Known Participant
December 18, 2008
Question

CF XML Output seems to work, but JS DOM has problems

  • December 18, 2008
  • 1 reply
  • 361 views
Hi everyone, I've recently run into a very, very frustrating problem with an application I am developing for work. I have output some XML data to an AJAX page using the below code. And I am able to get all the dateDifferenceTags, all the Number tags, and retrieve data from them. But I simply cannot find (and yes, I have googled it, and spent upward of 4 hours on it) a way to retrieve all of the "lesson" tags and get data that way.
What I have tried:

var lessonTags = xmldoc.getElementsByTagName("lesson")
alert(lessonTags[0].childNodes[0].nodeValue)

Then I wondered if I needed to put alert(lessonTags[0].childNodes[0].firstChild.nodeValue) and that isn't working either. Keep in mind that I am able to access the tags through retrieving them specifically, such as retrieving the dateDifferenceTag etc...

Any help here with either the CF or JS would be more than helpful. Thank you.



This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
December 21, 2008
In Coldfusion, you can search using the xmlSearch function and XPath, as in the following example: