I have written some code that is meant to parse an xml file and put the elements from the xml dom to the document's dom. I thought it might be as easy as saying
Code:
document.getElementById('replaceme').innerHTML = '';
document.getElementById('replaceme').appendChild(xmlNode);
But it turns out that is not the case. So I have made an elaborate script that creates the elements manually and sets their attributes according to the attributes of the xml document.

I have noticed a strange behaviour with short tags, where the firstChild.data is empty. If I put a single space and have the full tag, it works ok.

examples:
single space added ( correct behaviour )
http://www.antzcode.com/dom/spaces.htm
http://www.antzcode.com/dom/spaces.xml

Empty tags ( no space )

http://www.antzcode.com/dom/empty.htm
http://www.antzcode.com/dom/empty.xml

the code:
http://www.antzcode.com/dom/AntzUpdateDom1.js

Any help is greatly appreciated, as it will greatly enhance my potential with OOP PHP if I can get it to work properly.