« Gates[1] = 'Ray Ozzie' | Main | e4xDOM »

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.