Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 34702 invoked from network); 27 Jul 2007 20:58:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jul 2007 20:58:05 -0000 Received: (qmail 45489 invoked by uid 500); 27 Jul 2007 20:58:03 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 45389 invoked by uid 500); 27 Jul 2007 20:58:03 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 45380 invoked by uid 500); 27 Jul 2007 20:58:03 -0000 Delivered-To: apmail-jakarta-commons-dev@jakarta.apache.org Received: (qmail 45377 invoked by uid 500); 27 Jul 2007 20:58:03 -0000 Delivered-To: apmail-jakarta-commons-cvs@jakarta.apache.org Received: (qmail 45370 invoked by uid 99); 27 Jul 2007 20:58:03 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 13:58:03 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 20:58:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9DC641A981A; Fri, 27 Jul 2007 13:57:41 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r560379 - in /jakarta/commons/proper/scxml/trunk: src/main/java/org/apache/commons/scxml/model/ src/test/java/org/apache/commons/scxml/model/ xdocs/guide/ Date: Fri, 27 Jul 2007 20:57:41 -0000 To: commons-cvs@jakarta.apache.org From: rahul@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070727205741.9DC641A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Jul 27 13:57:40 2007 New Revision: 560379 URL: http://svn.apache.org/viewvc?view=rev&rev=560379 Log: Delete existing child nodes before adding new ones ( semantics) SCXML-51 Modified: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml jakarta/commons/proper/scxml/trunk/xdocs/guide/datamodel.xml Modified: jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java?view=diff&rev=560379&r1=560378&r2=560379 ============================================================================== --- jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java (original) +++ jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Assign.java Fri Jul 27 13:57:40 2007 @@ -195,8 +195,14 @@ } else { newNode = eval.evalLocation(ctx, expr); } + // Remove all children + for (Node child = oldNode.getFirstChild(); + child != null; + child = child.getNextSibling()) { + oldNode.removeChild(child); + } if (newNode != null) { - // adopt children, possible spec clarification needed + // Adopt new children for (Node child = newNode.getFirstChild(); child != null; child = child.getNextSibling()) { Modified: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java?view=diff&rev=560379&r1=560378&r2=560379 ============================================================================== --- jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java (original) +++ jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/AssignTest.java Fri Jul 27 13:57:40 2007 @@ -69,7 +69,7 @@ public void testAssignSrc() { Set currentStates = exec.getCurrentStatus().getStates(); assertEquals(1, currentStates.size()); - assertEquals("assign2", ((State)currentStates.iterator(). + assertEquals("assign3", ((State)currentStates.iterator(). next()).getId()); assertTrue(exec.getCurrentStatus().isFinal()); } Modified: jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml?view=diff&rev=560379&r1=560378&r2=560379 ============================================================================== --- jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml (original) +++ jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/assign-test.xml Fri Jul 27 13:57:40 2007 @@ -17,6 +17,7 @@ --> @@ -44,6 +45,26 @@ - + + + + + 10 + + + 20 + + + + + + + + + + + + Modified: jakarta/commons/proper/scxml/trunk/xdocs/guide/datamodel.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/xdocs/guide/datamodel.xml?view=diff&rev=560379&r1=560378&r2=560379 ============================================================================== --- jakarta/commons/proper/scxml/trunk/xdocs/guide/datamodel.xml (original) +++ jakarta/commons/proper/scxml/trunk/xdocs/guide/datamodel.xml Fri Jul 27 13:57:40 2007 @@ -256,11 +256,13 @@ <assign location="Data(carrental, 'car/dates')" expr="Data(hotelbooking, 'hotel/stay')" /> - <!-- copies over all children of <stay>, the - <startdate> and <enddate> in this case --> + <!-- deletes all children of <dates> and then copies + over all children of <stay>, the <startdate> + and <enddate> in this case --> - In these cases, the node pointed by the expression is first cloned, and - then added as a child node to the node the lvalue points to.

+ In these cases, the children of the node pointed by the expression are + first cloned, and then added as children to the node the lvalue points + to.

--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org