You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2008/10/15 11:55:30 UTC

svn commit: r704833 - /forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java

Author: thorsten
Date: Wed Oct 15 02:55:30 2008
New Revision: 704833

URL: http://svn.apache.org/viewvc?rev=704833&view=rev
Log:
Fixing Stax implementation regarding content injection. Before we did not reset the xpath after we used it, meaning if you first used a xpath expression in a part and the next part did not provide one we reused the earlier one, which is wrong.

Modified:
    forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java

Modified: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
URL: http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java?rev=704833&r1=704832&r2=704833&view=diff
==============================================================================
--- forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java (original)
+++ forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java Wed Oct 15 02:55:30 2008
@@ -302,20 +302,22 @@
               pathElement = new LinkedHashSet<XMLEvent>();
             }
             injectionPoint = currentPath;
-            inject(pathElement, contractResultReader, injectionPoint);
             // as soon as you find the end element add
             // it back to the resultTree
           } else {
             // iterate through the children and add them
             // to the xpath defined
-            if (resultTree.containsKey(xpath))
+            if (resultTree.containsKey(xpath)){
               pathElement = resultTree.get(xpath);
-            else
+            }else{
               pathElement = new LinkedHashSet<XMLEvent>();
+            }
             injectionPoint = xpath;
-            inject(pathElement, contractResultReader, injectionPoint);
           }
-        }
+          inject(pathElement, contractResultReader, injectionPoint);
+          // cleaning path again
+          xpath="";
+          }
         break;
       case XMLStreamConstants.END_DOCUMENT:
         process = false;