r1420 - branches/bxe_2_0/relaxng

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Dec 15 15:15:42 2005
New Revision: 1420

Modified:
   branches/bxe_2_0/relaxng/ElementVAL.js
   branches/bxe_2_0/relaxng/NodeVAL.js
   branches/bxe_2_0/relaxng/RelaxNG.js
Log:
new zeroormore code and bxe:tabletype

Modified: branches/bxe_2_0/relaxng/ElementVAL.js
==============================================================================
--- branches/bxe_2_0/relaxng/ElementVAL.js	(original)
+++ branches/bxe_2_0/relaxng/ElementVAL.js	Thu Dec 15 15:15:42 2005
@@ -180,7 +180,7 @@
 XMLNodeElement.prototype.__defineGetter__ ("canHaveText",
 	function() {
 		
-		if (typeof this.vdom == "undefined") {
+		if (this.vdom ==null || typeof this.vdom == "undefined") {
 			//bad hack...
 			return true;
 		}

Modified: branches/bxe_2_0/relaxng/NodeVAL.js
==============================================================================
--- branches/bxe_2_0/relaxng/NodeVAL.js	(original)
+++ branches/bxe_2_0/relaxng/NodeVAL.js	Thu Dec 15 15:15:42 2005
@@ -113,7 +113,7 @@
 					} else { 
 						_msg = ctxt.node.localName +"("+ctxt.node.namespaceURI+ ") ";
 					}
-				if (ctxt.node.parentNode.isAllowedChild(ctxt.node)) {
+				if (ctxt.node.parentNode.isAllowedChild(ctxt.node.namespaceURI, ctxt.node.localName)) {
 					
 					_msg += "is not allowed at this position as child of  " + this.localName ;
 				}
@@ -195,11 +195,14 @@
 }
 
 ContextVDOM.prototype.nextVDOM = function() {
-	var startVdom =this.vdom;
+	if (this.vdom == null || typeof this.vdom == 'undefined') {
+		return null;
+	}
 	var nextSib = this.vdom.getNextSibling(this);
 	if (nextSib) {
 		this.vdom = nextSib;
 	}  else {
+		this.vdom = null;
 		return null;
 	}
 	return this.vdom;

Modified: branches/bxe_2_0/relaxng/RelaxNG.js
==============================================================================
--- branches/bxe_2_0/relaxng/RelaxNG.js	(original)
+++ branches/bxe_2_0/relaxng/RelaxNG.js	Thu Dec 15 15:15:42 2005
@@ -459,7 +459,9 @@
 					}
 					this.bxeMenuentry.push(_entry);
 					break;
-		
+				case "tabletype":
+					this.bxeTabletype = childNodes[i].firstChild.data;
+					break;
 			}
 		}
 		
@@ -514,11 +516,18 @@
 				this._hasEmpty = false;
 				break;
 			case "zeroOrMore":
+				/* old code
 				newOneOrMore = new OneOrMoreVDOM(childNodes[i]);
 				this.appendChild(newOneOrMore);
 				newOneOrMore.appendChild(new EmptyVDOM());
 				newOneOrMore.parseChildren(childNodes[i]);
 				this._hasEmpty = false;
+				*/
+				/* code from 1.1 branch */
+				newZeroOrMore = new ZeroOrMoreVDOM(childNodes[i]);
+				this.appendChild(newZeroOrMore);
+				this._hasEmpty = true;
+				newZeroOrMore.parseChildren(childNodes[i]);
 				break;
 			case "attribute":
 				this.addAttributeNode( new AttributeVDOM(childNodes[i]));
@@ -715,19 +724,20 @@
 
 	while (child) {
 		if (child.isValid(ctxt)) {
+			ctxt.setVDOM(this, refsPosition);
 			return true;
 		}
 		child = child.getNextSibling(ctxt);
 	}
+	
+	ctxt.setVDOM(this, refsPosition);
 	var vdom = ctxt.nextVDOM();
 	if (vdom) {
-		var v =  vdom.isValid(ctxt);
-		if (v) {
-			ctxt.setVDOM(this, refsPosition);
-		}
-		return v;
+		return vdom.isValid(ctxt); 
+	} else { 
+		return false;
 	}
-	return false;
+	
 }
 
 ZeroOrMoreVDOM.prototype.allowedElements = function(ctxt) {
-- 
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.