r1836 - in trunk: mozile/td relaxng

[email protected] Wed, 21 May 2008 17:02:19 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Wed May 21 17:02:18 2008
New Revision: 1836

Log:
fix firefox 3 issues ..


Modified:
   trunk/mozile/td/http.js
   trunk/relaxng/DocumentVDOM.js

Modified: trunk/mozile/td/http.js
==============================================================================
--- trunk/mozile/td/http.js	(original)
+++ trunk/mozile/td/http.js	Wed May 21 17:02:18 2008
@@ -87,6 +87,16 @@
 	// if there's no element called parsererror...
 
 	if (p.getElementsByTagNameNS("http://www.mozilla.org/newlayout/xml/parsererror.xml","parsererror").length == 0) {
+		//fix firefox 3 issue (can't access node, without making a new documenting and adopting the node;
+		try {
+			p.documentElement.nodeName;
+		} catch (e) {
+			var d = document.implementation.createDocument("","",null);
+			d.appendChild(d.adoptNode(p.documentElement,true));
+			d.td = p.td;
+			d.loader =p.loader;
+			p = d;
+		}
 		reqObj.document = p;
 		reqObj.isError = false;
 		reqObj.status = 200;

Modified: trunk/relaxng/DocumentVDOM.js
==============================================================================
--- trunk/relaxng/DocumentVDOM.js	(original)
+++ trunk/relaxng/DocumentVDOM.js	Wed May 21 17:02:18 2008
@@ -27,9 +27,17 @@
 DocumentVDOM.prototype.parseSchema = function() {
 	//if it's an XMLSchema File
 	if (!this.xmldoc.documentElement) {
-		
 		alert("Validation Document could not be loaded. \n" + this.xmldoc.saveXML(this.xmldoc));
 	}
+	//fix firefox 3 issue (can't access node, without making a new documenting and adopting the node;
+	try {
+		this.xmldoc.documentElement.localName;
+	} catch (e) {
+		var d = document.implementation.createDocument("","",null);
+		d.appendChild(d.adoptNode(this.xmldoc.documentElement,true));
+		this.xmldoc = d;
+	}
+
 	if (this.xmldoc.documentElement.localName == "schema" &&
 		this.xmldoc.documentElement.namespaceURI == "http://www.w3.org/2001/XMLSchema" ) {
 		alert("XML Schema validation is not supported. You have to use Relax NG");
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs