rem: elmt = doc.createElement(templateNode.tag); 
add: elmt = tag == "input" ? SimileAjax.DOM.createInputElement(templateNode.type) : doc.createElement(tag);  
context: SimileAjax.DOM._createDOMFromTemplate = function(doc, templateNode, result, parentElmt) {    if (typeof templateNode == "string") {        var node = doc.createTextNode(templateNode);        if (parentElmt != null) {            parentElmt.appendChild(node);        }        return node;    } else {        var elmt = null;        if ("tag" in templateNode) {            var tag = templateNode.tag;            if (parentElmt != null) {                if (tag == "tr") {                    elmt = parentElmt.insertRow(parentElmt.rows.length);                } else if (tag == "td") {                    elmt = parentElmt.insertCell(parentElmt.cells.length);                }            }            if (elmt == null) {                elmt = doc.createElement(templateNode.tag);                if (parentElmt != null) {                    parentElmt.appendChild(elmt);                }            }        } else {            elmt = templateNode.elmt;            if (parentElmt != null) {                parentElmt.appendChild(elmt);            }        }                for (attribute in templateNode) {            var value = templateNode[attribute];                        if (attribute == "field") {                result[value] = elmt;                            } else if (attribute == "className") {                elmt.className = value;            } else if (attribute == "id") {                elmt.id = value;            } else if (attribute == "title") {                elmt.title = value;            } else if (attribute == "type" && elmt.tagName == "input") {                elmt.type = value;                            } else if (attribute == "children") {                for (var i = 0; i < value.length; i++) {                    Longwell.DOM._createDOMFromTemplate(doc, value[i], result, elmt);                }            } else if (attribute != "tag" && attribute != "elmt") {                elmt.setAttribute(attribute, value);            }        }        return elmt;    }}
meta: 6194	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6194/6b9c9a1223dcd49e046ac37241609e6248667b71/dom.js/clean/src/webapp/api/scripts/dom.js