Author: midon
Date: Tue Jul  8 14:53:33 2008
New Revision: 674988

URL: http://svn.apache.org/viewvc?rev=674988&view=rev
Log:
use replaceContent when header value is a TextNode

Modified:
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java

Modified: 
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java?rev=674988&r1=674987&r2=674988&view=diff
==============================================================================
--- 
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java 
(original)
+++ 
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java 
Tue Jul  8 14:53:33 2008
@@ -402,14 +402,13 @@
                         rvalue = ((Document)rvalue).getDocumentElement();
                 }
 
-                if (headerAssign && 
lvaluePtr.getParentNode().getNodeName().equals("message")) {
-                    lvalue = copyInto((Element)lvalue, (Element) lvaluePtr, 
rvalue);
+                if (headerAssign && 
lvaluePtr.getParentNode().getNodeName().equals("message") && 
rvalue.getNodeType()==Node.ELEMENT_NODE) {
+                    lvalue = copyInto((Element)lvalue, (Element) lvaluePtr, 
(Element) rvalue);
                 } else if (rvalue.getNodeType() == Node.ELEMENT_NODE && 
lvaluePtr.getNodeType() == Node.ELEMENT_NODE) {
                     lvalue = replaceElement((Element)lvalue, (Element) 
lvaluePtr, (Element) rvalue,
                             ocopy.keepSrcElementName);
                 } else {
-                    lvalue = replaceContent(lvalue, lvaluePtr, rvalue
-                            .getTextContent());
+                    lvalue = replaceContent(lvalue, lvaluePtr, 
rvalue.getTextContent());
                 }
                 final VariableInstance lval = 
_scopeFrame.resolve(ocopy.to.getVariable());
                 if (__log.isDebugEnabled())
@@ -469,7 +468,7 @@
         return (lval == ptr) ? replacement :  lval;
     }
 
-    private Element copyInto(Element lval, Element ptr, Node src) {
+    private Element copyInto(Element lval, Element ptr, Element src) {
         ptr.appendChild(ptr.getOwnerDocument().importNode(src, true));
         return lval;
     }


Reply via email to