From: Wolfgang M. M. <wol...@us...> - 2004-04-23 13:07:57
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2156/src/org/exist/dom Modified Files: ElementImpl.java DocumentImpl.java Log Message: A large number of XUpdate bugs has been fixed. Index: ElementImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/ElementImpl.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ElementImpl.java 2 Mar 2004 12:51:23 -0000 1.29 --- ElementImpl.java 23 Apr 2004 13:07:48 -0000 1.30 *************** *** 1055,1063 **** } if (attributes.length() > 0) ! buf.append(attributes); if (childNodes.getLength() > 0) { buf.append(">"); ! buf.append(children); buf.append("</"); buf.append(nodeName); --- 1055,1063 ---- } if (attributes.length() > 0) ! buf.append(attributes.toString()); if (childNodes.getLength() > 0) { buf.append(">"); ! buf.append(children.toString()); buf.append("</"); buf.append(nodeName); *************** *** 1177,1183 **** // remove old child nodes NodeList nodes = getChildNodes(); ! NodeImpl child; ! for (int i = 0; i < nodes.getLength(); i++) { ! child = (NodeImpl) nodes.item(i); removeAll( child, --- 1177,1190 ---- // remove old child nodes NodeList nodes = getChildNodes(); ! NodeImpl child, last = this; ! long firstChildId = firstChildID(); ! int i = nodes.getLength(); ! for ( ; i > 0; i--) { ! child = (NodeImpl) nodes.item(i - 1); ! if(child.getNodeType() == Node.ATTRIBUTE_NODE) { ! firstChildId = child.gid + 1; ! last = child; ! break; ! } removeAll( child, *************** *** 1187,1193 **** } ownerDocument.broker.endRemove(); ! children = 0; // append new content ! appendChildren(firstChildID(), this, newContent, true); ownerDocument.broker.update(this); // reindex if required --- 1194,1200 ---- } ownerDocument.broker.endRemove(); ! children = i; // append new content ! appendChildren(firstChildId, last, newContent, true); ownerDocument.broker.update(this); // reindex if required Index: DocumentImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/DocumentImpl.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** DocumentImpl.java 25 Mar 2004 13:25:56 -0000 1.35 --- DocumentImpl.java 23 Apr 2004 13:07:48 -0000 1.36 *************** *** 143,146 **** --- 143,148 ---- this.ownerDocument = this; this.collection = old.collection; + if(old.collection == null) + throw new RuntimeException("Collection == null"); this.children = old.children; this.maxDepth = old.maxDepth; |