rem: dojo.body().removeChild(tn); 
add: dojo.html.destroyNode(tn); 
context: dojo.html.createNodesFromText = function(/* string */txt, /* boolean? */trim){	//	summary	//	Attempts to create a set of nodes based on the structure of the passed text.	if(trim) { txt = txt.replace(/^\s+|\s+$/g, ""); }	var tn = dojo.doc().createElement("div");	// tn.style.display = "none";	tn.style.visibility= "hidden";	dojo.body().appendChild(tn);	var tableType = "none";	if((/^<t[dh][\s\r\n>]/i).test(txt.replace(/^\s+/))) {		txt = "<table><tbody><tr>" + txt + "</tr></tbody></table>";		tableType = "cell";	} else if((/^<tr[\s\r\n>]/i).test(txt.replace(/^\s+/))) {		txt = "<table><tbody>" + txt + "</tbody></table>";		tableType = "row";	} else if((/^<(thead|tbody|tfoot)[\s\r\n>]/i).test(txt.replace(/^\s+/))) {		txt = "<table>" + txt + "</table>";		tableType = "section";	}	tn.innerHTML = txt;	if(tn["normalize"]){		tn.normalize();	}	var parent = null;	switch(tableType) {		case "cell":			parent = tn.getElementsByTagName("tr")[0];			break;		case "row":			parent = tn.getElementsByTagName("tbody")[0];			break;		case "section":			parent = tn.getElementsByTagName("table")[0];			break;		default:			parent = tn;			break;	}	/* this doesn't make much sense, I'm assuming it just meant trim() so wrap was replaced with trim	if(wrap){		var ret = [];		// start hack		var fc = tn.firstChild;		ret[0] = ((fc.nodeValue == " ")||(fc.nodeValue == "\t")) ? fc.nextSibling : fc;		// end hack		// tn.style.display = "none";		dojo.body().removeChild(tn);		return ret;	}	*/	var nodes = [];	for(var x=0; x<parent.childNodes.length; x++){		nodes.push(parent.childNodes[x].cloneNode(true));	}	tn.style.display = "none"; // FIXME: why do we do this?	dojo.body().removeChild(tn);	return nodes;	//	array}
meta: 4707	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4707/50c3492c4c3c825dbd3401e134a19ed46799c456/util.js/clean/www/resources/dojo-ajax/src/html/util.js