r1411 - in trunk: js relaxng

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Oct  6 20:52:18 2005
New Revision: 1411

Modified:
   trunk/js/bxeXMLNode.js
   trunk/relaxng/NodeVAL.js
   trunk/relaxng/RelaxNG.js
Log:
some improvements for oneOrMore

Modified: trunk/js/bxeXMLNode.js
==============================================================================
--- trunk/js/bxeXMLNode.js	(original)
+++ trunk/js/bxeXMLNode.js	Thu Oct  6 20:52:18 2005
@@ -761,12 +761,12 @@
 	} else {
 		var ac = this.allowedChildren;
 		if (ac.length == 1)  {
-			eDOMEventCall("appendChildNode",document,{"appendToNode": this, "localName":ac[0].nodeName,"namespaceURI":ac[0].namespaceURI});
+			eDOMEventCall("appendChildNode",document,{"appendToNode": this, "localName":ac[0].localName,"namespaceURI":ac[0].namespaceURI});
 		} else if (ac.length > 1) {
 			var _hasMust = false;
 			for ( var i in ac) {
 				if (!(ac[i].optional ) ) { 
-					eDOMEventCall("appendChildNode",document,{ "appendToNode": this, "localName":ac[i].nodeName,"namespaceURI":ac[i].namespaceURI});
+					eDOMEventCall("appendChildNode",document,{ "appendToNode": this, "localName":ac[i].localName,"namespaceURI":ac[i].namespaceURI});
 					_hasMust =true;
 				}
 				

Modified: trunk/relaxng/NodeVAL.js
==============================================================================
--- trunk/relaxng/NodeVAL.js	(original)
+++ trunk/relaxng/NodeVAL.js	Thu Oct  6 20:52:18 2005
@@ -93,7 +93,7 @@
 			
 			if(ctxt.node.hasChildNodes()) {
 				if (deep) {
-					dump (ctxt.node.localName + " has  ChildNodes\n");
+					//dump (ctxt.node.localName + " has  ChildNodes\n");
 					var refsPosition = ctxt.refs.length;
 					//var oldVdom = ctxt.node.vdom;
 					oldVdom = ctxt.vdom;	
@@ -103,7 +103,7 @@
 					} 
 				}
 			} else if (ctxt.node.nodeType == 1) {
-				dump (ctxt.node.localName + " has no ChildNodes\n");
+				//dump (ctxt.node.localName + " has no ChildNodes\n");
 				/*var refsPosition = ctxt.refs.length;
 				oldVdom = ctxt.vdom;	
 				var retctxt = ctxt.node._isNodeValid(deep,  wFValidityCheckLevel )

Modified: trunk/relaxng/RelaxNG.js
==============================================================================
--- trunk/relaxng/RelaxNG.js	(original)
+++ trunk/relaxng/RelaxNG.js	Thu Oct  6 20:52:18 2005
@@ -474,6 +474,7 @@
 				this.appendChild(newOneOrMore);
 				newOneOrMore.appendChild(new EmptyVDOM());
 				newOneOrMore.parseChildren(childNodes[i]);
+				newOneOrMore.optional = true;
 				this._hasEmpty = false;
 				break;
 			case "attribute":
@@ -693,9 +694,11 @@
 			var subac = child.allowedElements(ctxt);
 			if (subac) {
 				if (subac.nodeName) {
+					subac.optional = true;
 					ac.push(subac);
 				} else {
 					for (var i = 0; i < subac.length; i++) {
+						subac[i].optional = true;
 						ac.push(subac[i]);
 					}
 				}
@@ -917,9 +920,15 @@
 		var subac = child.allowedElements(ctxt);
 		if (subac) {
 			if (subac.nodeName) {
+				if (this.optional) {
+					subac.optional = true;
+				}
 				ac.push(subac);
 			} else {
 				for (var i = 0; i < subac.length; i++) {
+					if (this.optional) {
+						subac[i].optional = true;
+					}
 					ac.push(subac[i]);
 				}
 			}
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.