[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 /* 2 * FCKeditor - The text editor for internet 3 * Copyright (C) 2003-2005 Frederico Caldeira Knabben 4 * 5 * Licensed under the terms of the GNU Lesser General Public License: 6 * http://www.opensource.org/licenses/lgpl-license.php 7 * 8 * For further information visit: 9 * http://www.fckeditor.net/ 10 * 11 * "Support Open Source software. What about a donation today?" 12 * 13 * File Name: fckxml_gecko.js 14 * FCKXml Class: class to load and manipulate XML files. 15 * 16 * File Authors: 17 * Frederico Caldeira Knabben (fredck@fckeditor.net) 18 */ 19 20 var FCKXml ; 21 22 if ( !( FCKXml = NS.FCKXml ) ) 23 { 24 FCKXml = NS.FCKXml = function() 25 {} 26 27 FCKXml.prototype.LoadUrl = function( urlToCall ) 28 { 29 var oFCKXml = this ; 30 31 var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ; 32 oXmlHttp.open( "GET", urlToCall, false ) ; 33 oXmlHttp.send( null ) ; 34 35 if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ) 36 this.DOMDocument = oXmlHttp.responseXML ; 37 else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) 38 this.DOMDocument = oXmlHttp.responseXML ; 39 else 40 alert( 'Error loading "' + urlToCall + '"' ) ; 41 } 42 43 FCKXml.prototype.SelectNodes = function( xpath, contextNode ) 44 { 45 var aNodeArray = new Array(); 46 47 var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument, 48 this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ; 49 if ( xPathResult ) 50 { 51 var oNode = xPathResult.iterateNext() ; 52 while( oNode ) 53 { 54 aNodeArray[aNodeArray.length] = oNode ; 55 oNode = xPathResult.iterateNext(); 56 } 57 } 58 return aNodeArray ; 59 } 60 61 FCKXml.prototype.SelectSingleNode = function( xpath, contextNode ) 62 { 63 var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument, 64 this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null); 65 66 if ( xPathResult && xPathResult.singleNodeValue ) 67 return xPathResult.singleNodeValue ; 68 else 69 return null ; 70 } 71 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |