Ticket #239: process xml node.patch

File process xml node.patch, 1.4 KB (added by alfonsoml, 3 years ago)

Alternative solution

  • fckxhtml.js

     
    251251                        catch (e) { /* Do nothing... probably this is a wrong format comment. */ } 
    252252                        break ; 
    253253 
     254                // Document 
     255                case 9 : 
     256                        // If IE finds an <xml> tag it does treat it as a document 
     257 
     258                        // Get the element name. 
     259                        var sNodeName = htmlNode.tagName.toLowerCase()  ; 
     260 
     261                        if ( FCKBrowserInfo.IsIE ) 
     262                        { 
     263                                // IE doens't include the scope name in the nodeName. So, add the namespace. 
     264                                if ( htmlNode.scopeName && htmlNode.scopeName != 'HTML' && htmlNode.scopeName != 'FCK' ) 
     265                                        sNodeName = htmlNode.scopeName.toLowerCase() + ':' + sNodeName ; 
     266                        } 
     267                        else 
     268                        { 
     269                                if ( sNodeName.StartsWith( 'fck:' ) ) 
     270                                        sNodeName = sNodeName.Remove( 0,4 ) ; 
     271                        } 
     272                        var oNode = this._CreateNode( sNodeName ) ; 
     273 
     274                        // The node doesn't provide any children nodes in the DOM, but it shows them as innerHTML 
     275                        oNode.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( htmlNode.innerHTML ) ) ) ; 
     276 
     277                        if ( !oNode ) 
     278                                return false ; 
     279 
     280                        xmlNode.appendChild( oNode ) ; 
     281 
     282                        break; 
     283 
    254284                // Unknown Node type. 
    255285                default : 
    256286                        xmlNode.appendChild( this.XML.createComment( "Element not supported - Type: " + htmlNode.nodeType + " Name: " + htmlNode.nodeName ) ) ;