servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r517612 - /incubator/servicemix/branches/servicemix-3.1/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/XPathSplitter.java
Date Tue, 13 Mar 2007 09:38:52 GMT
Author: gnodet
Date: Tue Mar 13 02:38:51 2007
New Revision: 517612

URL: http://svn.apache.org/viewvc?view=rev&rev=517612
Log:
SM-879: EIP XPath Splitter and Drools3.1 used together cause problems in xpath evaluation

Modified:
    incubator/servicemix/branches/servicemix-3.1/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/XPathSplitter.java

Modified: incubator/servicemix/branches/servicemix-3.1/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/XPathSplitter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/XPathSplitter.java?view=diff&rev=517612&r1=517611&r2=517612
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/XPathSplitter.java
(original)
+++ incubator/servicemix/branches/servicemix-3.1/deployables/serviceengines/servicemix-eip/src/main/java/org/apache/servicemix/eip/patterns/XPathSplitter.java
Tue Mar 13 02:38:51 2007
@@ -27,6 +27,7 @@
 import org.apache.servicemix.expression.JAXPNodeSetXPathExpression;
 import org.apache.servicemix.expression.MessageVariableResolver;
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
@@ -46,6 +47,8 @@
      * The xpath expression to use to split 
      */
     private JAXPNodeSetXPathExpression xpathExpression = new JAXPNodeSetXPathExpression();
+    
+    private SourceTransformer sourceTransformer = new SourceTransformer();
 
     /* (non-Javadoc)
      * @see org.apache.servicemix.eip.EIPEndpoint#validate()
@@ -64,11 +67,12 @@
      * @see org.apache.servicemix.components.eip.AbstractSplitter#split(javax.xml.transform.Source)
      */
     protected Source[] split(Source main) throws Exception {
-        Node doc = new SourceTransformer().toDOMNode(main);
+        Node doc = sourceTransformer.toDOMNode(main);
         NodeList nodes = (NodeList) xpathExpression.evaluateXPath(doc);
         Source[] parts = new Source[nodes.getLength()];
         for (int i = 0; i < parts.length; i++) {
-            parts[i] = new DOMSource(nodes.item(i));
+            Document part = sourceTransformer.toDOMDocument(nodes.item(i));
+            parts[i] = new DOMSource(part);
         }
         return parts;
     }



Mime
View raw message