rem: tmp[count]={a:d.getAttributeNS(jimNS, "fID"),b:[foafNS+"knows"],c:d.getAttributeNS(foafNS, "nick")} 
add: tmp[count]={a:d.getAttributeNS(foafNS, "mbox_sha1sum"),b:[foafNS+"knows"],c:d.getAttributeNS(foafNS, "nick")} 
context: function opComplete(urlRS) { // The callback function called when the data url is returned // from the server. try {   var doc=parseXML(urlRS.content,null);   thisProxy=this   // get all the foaf:knows elements, and loop over them   // not using RDF parser, but you could put mine in here   // but it would be slower!   // for each element create an object (a,b,c,d)   // (sha1,knows|isknownby|codepicts,nick,img)   // img is only for codepicts obviously.   dirs=doc.getElementsByTagNameNS(foafNS,"knows");   dirList=new Array();   count=0;   var tmp=[]   for (var i=0; i < dirs.length; i++) {    var d=dirs.item(i)    tmp[count]={a:d.getAttributeNS(jimNS, "fID"),b:[foafNS+"knows"],c:d.getAttributeNS(foafNS, "nick")}				tmp[tmp[count].a]=tmp[count]    count++;   }   thisProxy.kCount=count   // same again this time with jim:isKnownBy, but this time    // changing b if the person already exists.   dirs=doc.getElementsByTagNameNS(jimNS,"isKnownBy");   for (var i=0; i < dirs.length; i++) {    var d=dirs.item(i)    var r=d.getAttributeNS(foafNS, "mbox_sha1sum")				if (!tmp[r]) {     tmp[count]={a:r,b:[jimNS+"isKnownBy"],c:d.getAttributeNS(foafNS, "nick")}	 			tmp[r]=tmp[count]     count++;				} else {     tmp[r].b=[jimNS+"isKnownBy",foafNS+"knows"]				}   }   thisProxy.knownCount=dirs.length   // and again with codepicts.   dirs=doc.getElementsByTagNameNS(foafNS,"codepiction");   for (var i=0; i < dirs.length; i++) {    var d=dirs.item(i)    var r=d.getAttributeNS(foafNS, "mbox_sha1sum")				if (!tmp[r]) {     tmp[count]={a:r,b:[foafNS+"codepiction"],c:d.getAttributeNS(foafNS, "nick"),d:d.getAttributeNS(imgNS, "naughty")}	 			tmp[r]=tmp[count]     count++;				} else {     tmp[r].b.push(foafNS+"codepiction")				}   }   thisProxy.cCount=dirs.length   // go through all the people we just found, and create a new   // Director object for each. 			for (i=0;i<tmp.length;i++) {    dirList[i]=new Director(tmp[i].a,startURL+tmp[i].a+endURL,tmp[i].b,tmp[i].c,tmp[i].d);			}	  // Get the email addresses, sha1sums, nick etc. for the    // blub you expanded   dirs=doc.getElementsByTagNameNS(foafNS,"mbox");   thisProxy.mboxes=[]   for (var i=0; i < dirs.length; i++) {    var mbox=dirs.item(i).getAttributeNS(rdfNS, "resource")    blubhash[mbox]=thisProxy    thisProxy.mboxes[thisProxy.mboxes.length]=mbox   }   dirs=doc.getElementsByTagNameNS(jimNS,"fID");   for (var i=0; i < dirs.length; i++) {    var sha=dirs.item(i).firstChild.data    blubhash[sha]=thisProxy   }    addDirs(thisProxy.id)    try {     thisProxy.nick=doc.getElementsByTagNameNS(foafNS,"nick").item(0).firstChild.data.toUpperCase()     thisProxy.text.firstChild.setData(thisProxy.nick)    } catch (e) {	}    try {     thisProxy.realName=doc.getElementsByTagNameNS(foafNS,"name").item(0).firstChild.data    } catch (e) {	}    try {     thisProxy.homepage=doc.getElementsByTagNameNS(foafNS,"homepage").item(0).firstChild.data    } catch (e) {	}	   // Do Image stuff   var img=doc.getElementsByTagNameNS(foafNS,"depiction");   if (img.item(0)) {    var imgurl=img.item(0).getAttributeNS(rdfNS, "resource")    found=false				// Is there an image with polypath etc.?    descs=doc.getElementsByTagNameNS(rdfNS,"Description");				for (i=0;i<descs.length;i++) {     var di=descs.item(i)					if (di.getAttributeNS(rdfNS, "about")==imgurl) {      var polypath=di.getElementsByTagNameNS(imgNS,"polypath").item(0).firstChild.nodeValue;      var height=di.getElementsByTagNameNS(imgNS,"height").item(0).firstChild.nodeValue;      var width=di.getElementsByTagNameNS(imgNS,"width").item(0).firstChild.nodeValue;      thisProxy.depiction=new Depiction(imgurl,height,width,polypath)      found=true					}			 }				if (!found) {     thisProxy.depiction=new Depiction(imgurl,0,0,'')				}   } else {    thisProxy.depiction=new Depiction('',0,0,'')			}	// Finally call updatePanel, which creates the control panels, and images.  updatePanel(thisProxy)	} catch (e) {}		}
meta: 142	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/142/cc6ca17d004eec83c3f03bb3103c248b3b5cb864/foafnaut.templates.js/buggy/foafnaut.org/htdocs/foaf/foafnaut.templates.js