forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r704833 - /forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
Date Wed, 15 Oct 2008 09:55:30 GMT
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;



Mime
View raw message