2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
\r
3 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
\r
5 * == BEGIN LICENSE ==
\r
7 * Licensed under the terms of any of the following licenses at your
\r
10 * - GNU General Public License Version 2 or later (the "GPL")
\r
11 * http://www.gnu.org/licenses/gpl.html
\r
13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
\r
14 * http://www.gnu.org/licenses/lgpl.html
\r
16 * - Mozilla Public License Version 1.1 or later (the "MPL")
\r
17 * http://www.mozilla.org/MPL/MPL-1.1.html
\r
21 * FCKXml Class: class to load and manipulate XML files.
\r
22 * (IE specific implementation)
\r
27 LoadUrl : function( urlToCall )
\r
29 this.Error = false ;
\r
31 var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
\r
39 oXmlHttp.open( "GET", urlToCall, false ) ;
\r
41 oXmlHttp.send( null ) ;
\r
43 if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
\r
45 this.DOMDocument = oXmlHttp.responseXML ;
\r
47 // #1426: Fallback if responseXML isn't set for some
\r
48 // reason (e.g. improperly configured web server)
\r
49 if ( !this.DOMDocument || this.DOMDocument.firstChild == null )
\r
51 this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
\r
52 this.DOMDocument.async = false ;
\r
53 this.DOMDocument.resolveExternals = false ;
\r
54 this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
\r
59 this.DOMDocument = null ;
\r
62 if ( this.DOMDocument == null || this.DOMDocument.firstChild == null )
\r
65 if (window.confirm( 'Error loading "' + urlToCall + '"\r\nDo you want to see more info?' ) )
\r
66 alert( 'URL requested: "' + urlToCall + '"\r\n' +
\r
67 'Server response:\r\nStatus: ' + oXmlHttp.status + '\r\n' +
\r
68 'Response text:\r\n' + oXmlHttp.responseText ) ;
\r
72 SelectNodes : function( xpath, contextNode )
\r
75 return new Array() ;
\r
78 return contextNode.selectNodes( xpath ) ;
\r
80 return this.DOMDocument.selectNodes( xpath ) ;
\r
83 SelectSingleNode : function( xpath, contextNode )
\r
89 return contextNode.selectSingleNode( xpath ) ;
\r
91 return this.DOMDocument.selectSingleNode( xpath ) ;
\r