From: <jh...@us...> - 2011-07-09 00:26:35
|
Revision: 297 http://etch.svn.sourceforge.net/etch/?rev=297&view=rev Author: jheiss Date: 2011-07-09 00:26:29 +0000 (Sat, 09 Jul 2011) Log Message: ----------- Use REXML's deep_clone rather than dup or clone in xmlcopyelem. I originaly used dup, but switched to clone in commit 267. dup made a copy that wasn't really a copy, xmlsettext would change the original as well. clone fixed that problem, but it turns out it didn't copy the contents of the element. So <foo>text</foo> became <foo/>. deep_clone fixes those issues. (And the unit tests now test for both of those issues.) Modified Paths: -------------- trunk/server/lib/etch.rb Modified: trunk/server/lib/etch.rb =================================================================== --- trunk/server/lib/etch.rb 2011-07-09 00:19:36 UTC (rev 296) +++ trunk/server/lib/etch.rb 2011-07-09 00:26:29 UTC (rev 297) @@ -1372,7 +1372,7 @@ when :nokogiri destelem << elem.dup when :rexml - destelem.add_element(elem.clone) + destelem.add_element(elem.deep_clone) else raise "Unknown XML library #{Etch.xmllib}" end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |