--- /dev/null
+define(['libs/jquery-1.9.1.min'], function($) {\r
+ return {\r
+ cleanUp: function(xml) {\r
+ \r
+ var rmws = function(node) {\r
+ if(node.nodeType === 3) {\r
+ node.data = $.trim(node.data);\r
+ }\r
+ else {\r
+ $(node).contents().each(function() {\r
+ rmws(this);\r
+ });\r
+ }\r
+ }\r
+ \r
+ xml = $($.trim(xml));\r
+ xml.each(function() {\r
+ rmws(this);\r
+ });\r
+ \r
+ /*var toret = xml\r
+ .replace(/(<.*>)\s*(<.*>)/gm, '$1$2')\r
+ .replace(/(<\/.*>)\s*(<\/.*>)/gm, '$1$2')\r
+ .replace(/(<\/.*>)\s*(<.*>)/gm, '$1$2');\r
+ return $.trim(toret);*/\r
+ return $('<div>').append(xml).html();\r
+ }\r
+ }\r
+});
\ No newline at end of file