/*
-** $Id: pz2.js,v 1.29 2007-06-04 10:56:28 jakub Exp $
+** $Id: pz2.js,v 1.30 2007-06-04 12:24:59 jakub Exp $
** pz2.js - pazpar2's javascript client library.
*/
//for each term in the list
for (j = 0; j < terms.length; j++) {
var term = {
- "name": terms[j].getElementsByTagName("name")[0].childNodes[0].nodeValue,
- "freq": terms[j].getElementsByTagName("frequency")[0].childNodes[0].nodeValue
+ "name": terms[j].getElementsByTagName("name")[0].childNodes[0].nodeValue || 'ERROR',
+ "freq": terms[j].getElementsByTagName("frequency")[0].childNodes[0].nodeValue || 'ERROR'
};
var termIdNode = terms[j].getElementsByTagName("id");