Index: /FCKeditor/trunk/editor/_source/internals/fckxhtml.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckxhtml.js	(revision 485)
+++ /FCKeditor/trunk/editor/_source/internals/fckxhtml.js	(revision 486)
@@ -29,5 +29,5 @@
 {
 	FCKXHtmlEntities.Initialize() ;
-	
+
 	// Set the correct entity to use for empty blocks.
 	this._NbspEntity = ( FCKConfig.ProcessHTMLEntities? 'nbsp' : '#160' ) ;
@@ -61,10 +61,10 @@
 	this.XML = null ;
 
+	// Safari adds xmlns="http://www.w3.org/1999/xhtml" to the root node (#963)
+	if ( FCKBrowserInfo.IsSafari )
+		sXHTML = sXHTML.replace( /^<xhtml.*?>/, '<xhtml>' ) ;
+
 	// Strip the "XHTML" root node.
-	// Workaround: Safari adds xmlns="http://www.w3.org/1999/xhtml" to the root node #963
-	if ( FCKBrowserInfo.IsSafari )
-		sXHTML = sXHTML.substr( 44, sXHTML.length - 52 ).Trim() ;
-	else
-		sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ;
+	sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ;
 
 	// Remove the trailing <br> added by Gecko.
@@ -455,5 +455,5 @@
 		if ( FCKBrowserInfo.IsGecko )
 			sHtml = FCKTools.HTMLDecode( sHtml );
-		
+
 		// Remove the saved urls here as the data won't be processed as nodes
 		sHtml = sHtml.replace( /\s_fcksavedurl="[^"]*"/g, '' ) ;
