r1754 - in branches/bxe_2_0: . js

[email protected] Thu, 13 Sep 2007 21:27:13 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Sep 13 21:27:13 2007
New Revision: 1754

Log:
nicer and more errormessage
BXEB-37


Modified:
   branches/bxe_2_0/bxeLoader.js
   branches/bxe_2_0/js/bxeXMLDocument.js

Modified: branches/bxe_2_0/bxeLoader.js
==============================================================================
--- branches/bxe_2_0/bxeLoader.js	(original)
+++ branches/bxe_2_0/bxeLoader.js	Thu Sep 13 21:27:13 2007
@@ -214,14 +214,26 @@
 
 function bxe_load_xml (xmlfile) {
 	
-	
 	var td = new mozileTransportDriver(bxe_config.xmlfile_method);
 	function callback (e) {
 		if (e.isError) {
-			alert("Error loading xml file \n"+e.statusText);
+			bxe_alert("Error loading XML document.\nSee console.log for details.");
+			if (console.log) {
+				console.log( e.statusText);
+			}
+			
 			return false;
 		}
 		var xmldoc =  e.document;
+		if (!xmldoc.documentElement) {
+			bxe_alert("Something went wrong during loading the XML document.\nSee console.log for details.");
+			if (console.log) {
+				console.log( "XMLDoc:" + xmldoc.saveXML());
+				console.log( e);
+			}
+			return false;
+		}
+		
 		bxe_config.xmldoc = xmldoc;
 		xmldoc.init();
 		if (bxe_config.xhtmlfile) {

Modified: branches/bxe_2_0/js/bxeXMLDocument.js
==============================================================================
--- branches/bxe_2_0/js/bxeXMLDocument.js	(original)
+++ branches/bxe_2_0/js/bxeXMLDocument.js	Thu Sep 13 21:27:13 2007
@@ -134,6 +134,15 @@
 	function onload_xsl(e) {
 		bxe_about_box.addText("XSLT loaded...");
 		xsldoc = e.currentTarget;
+		
+		if (!xsldoc.documentElement) {
+			bxe_alert("Something went wrong during loading the XSLT document.\nSee console.log for details.");
+			if (console.log) {
+				console.log( "XSLDoc: " + xsldoc.saveXML());
+				console.log( e);
+			}
+			return false;
+		}
 		var xsltransformdoc = document.implementation.createDocument("", "", null);
 		xsltransformdoc.addEventListener("load", this.onload_xsltransform, false);
 		xsltransformdoc.xsldoc = xsldoc;
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs