Has anyone got all the example Ajax Web Apps to work? I am stuck on the example in Chapter 6: Web Services and Slide-and-hide. I have a valid Amazon Access Key ID.

My code matches to book's downloadable code. Even if I 'cheat' and simply run the book's downloadable code, I get a problem with XMLParse.

I am getting the following error:

xmlDocElem has no properties in xmlparse.js

Using Firebug to investigate, it appears that the first parameter being passed across is undefined/null.

The code being used to call the xml2ObjArray is exactly the same as the "Call it like this:" comment.

// Takes an array of XML items, transforms into an array of JS objects
// Call it like this: res = XMLParse.xml2ObjArray(xml, 'Item');
this.xml2ObjArray = function(xmlDocElem, tagItemName) {
var self = XMLParse;
var xmlElemArray = new Array;
var xmlElemRow;
var objArray = [];

// Rows returned
if (xmlDocElem.hasChildNodes()) {
xmlElemArray = xmlDocElem.getElementsByTagName(tagItemName);
xmlElemRow = xmlElemArray[0];
// Create array of objects and set properties
for (var j = 0; j < xmlElemArray.length; j++) {
xmlElemRow = xmlElemArray[j];
objArray[j] = self.xmlElem2Obj(xmlElemArray[j]);
return objArray;

The JS library being used is an 'external' one: xmlparse.js. I assume it is being used with other web apps around the world outside of just this book.

Has anyone else come across this problem? It is driving me crazy, since the rest of the book's code has been, for the most part, fantastic.

Would more code snippets make it easier to help track down this problem? I didn't want to post all the source code because it is quite lengthy and most of it doesn't have anything to do with the problem.

Thanks in advance for any pointers.