Q

  • "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies." - C.A.R. Hoare

« Gates[1] = 'Ray Ozzie' | Main | e4x<-->DOM »

August 11, 2006

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d834d6a96169e200d834e117f969e2

Listed below are links to weblogs that reference DOM 2 e4x:

Comments

Jeremy French

Isn't this throwing the baby out with the bathwater a little.

function writeList(){
var xdoc = new XML((new XMLSerializer()).serializeToString(xmlDoc.documentElement));
var xlist = ;
for each (label in xdoc..label){
xlist.* += {label.name.text() + ' (' + label.@id + ')'};
}
var domNode = new DOMParser().parseFromString(xlist.toXMLString(),"text/xml").documentElement;
document.getElementById('updateTarget').appendChild(domNode);
}

Will do the same job and not rely on innerHTML.

Dan Sickles

Jeremy, you are correct. I was trying to minimize DOM usage under the assumption that Brendan and his javascript gurus will atually implement the e4x<>DOM integration someday. Then all the serialzing and parsing goes away. But yes, innerHTML is the greater of two evils so a little DOM code to make it go away is a win.

The comments to this entry are closed.