javascript/examples/grapheditor/www/js/Graph.js
function cleanNode(node)
			{
				var child = node.firstChild;
				
				while (child != null)
				{
					var next = child.nextSibling;
					cleanNode(child);
					child = next;
				}
				
				if ((node.nodeType != 1 || (node.nodeName !== 'BR' && node.firstChild == null)) &&
					(node.nodeType != 3 || mxUtils.trim(mxUtils.getTextContent(node)).length == 0))
				{
					node.parentNode.removeChild(node);
				}
				else
				{
					// Removes linefeeds
					if (node.nodeType == 3)
					{
						mxUtils.setTextContent(node, mxUtils.getTextContent(node).replace(/\n|\r/g, ''));
					}

					// Removes CSS classes and styles (for Word and Excel)
					if (node.nodeType == 1)
					{
						node.removeAttribute('style');
						node.removeAttribute('class');
						node.removeAttribute('width');
						node.removeAttribute('cellpadding');
						node.removeAttribute('cellspacing');
						node.removeAttribute('border');
					}
				}
			}
function cleanNode(node)
			{
				var child = node.firstChild;
				
				while (child != null)
				{
					var next = child.nextSibling;
					cleanNode(child);
					child = next;
				}
				
				if ((node.nodeType != 1 || (node.nodeName !== 'BR' && node.firstChild == null)) &&
					(node.nodeType != 3 || mxUtils.trim(mxUtils.getTextContent(node)).length == 0))
				{
					node.parentNode.removeChild(node);
				}
				else
				{
					// Removes linefeeds
					if (node.nodeType == 3)
					{
						mxUtils.setTextContent(node, mxUtils.getTextContent(node).replace(/\n|\r/g, ''));
					}

					// Removes CSS classes and styles (for Word and Excel)
					if (node.nodeType == 1)
					{
						node.removeAttribute('style');
						node.removeAttribute('class');
						node.removeAttribute('width');
						node.removeAttribute('cellpadding');
						node.removeAttribute('cellspacing');
						node.removeAttribute('border');
					}
				}
			}
function cleanNode ( node ) { var child = node . firstChild ; while ( child != null ) { var next = child . nextSibling ; cleanNode ( child ) ; child = next ; } if ( ( node . nodeType != 1 || ( node . nodeName !== 'BR' && node . firstChild == null ) ) && ( node . nodeType != 3 || mxUtils . trim ( mxUtils . getTextContent ( node ) ) . length == 0 ) ) { node . parentNode . removeChild ( node ) ; } else { // Removes linefeeds if ( node . nodeType == 3 ) { mxUtils . setTextContent ( node , mxUtils . getTextContent ( node ) . replace ( / \n|\r / g , '' ) ) ; } // Removes CSS classes and styles (for Word and Excel) if ( node . nodeType == 1 ) { node . removeAttribute ( 'style' ) ; node . removeAttribute ( 'class' ) ; node . removeAttribute ( 'width' ) ; node . removeAttribute ( 'cellpadding' ) ; node . removeAttribute ( 'cellspacing' ) ; node . removeAttribute ( 'border' ) ; } } }
Removes unused DOM nodes and attributes, recursively
Removes unused DOM nodes and attributes recursively