@@ -647,7 +706,7 @@ // import the fragment Node importNode = resource.importNode(fragment, true); if ( path.equals("") ) { // this is allowed in write - resource.appendChild(importNode); + resource.appendChild(importNode.getFirstChild()); message = "entire source overwritten";
Was this bit the DOM "bug"? Was it caused by whitespace outside root node when overwriting the whole document? There was some discussion about 9 months ago where some (at least one) thought that was mandatory behavior and the responsibility of the fragment author (or pipeline) to remove whitespace.
If you've changed that behavior I'm personally very +1 but it may be worth a discussion.
I don't think it's a matter of whitespace. I'm not a DOM guru, but if the firstChild is a whitespace node it should be returned by the getFistChild() call as well. Actually, I am a bit puzzled too, since the SWT wasn't working on my setup but it was on others (I suspect it has to do with the latest JVM that I'm using), no matter what sample documents I gave to him. With this one liner, everything was working OK, so I just thought to change it. But I'm more than open to any discussion. :-)
Ciao,
-- Gianugo Rabellino Pro-netics s.r.l. - http://www.pro-netics.com Orixo, the XML business alliance - http://www.orixo.com (Now blogging at: http://blogs.cocoondev.org/gianugo/)
