Updated Branches:
  refs/heads/ode-1.3.6.x 14a41fa0a -> 2f2c7b562

ODE-992: Added support for specifying xpath expression within CDATA section for 
propertyAlias/query


Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/2f2c7b56
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/2f2c7b56
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/2f2c7b56

Branch: refs/heads/ode-1.3.6.x
Commit: 2f2c7b562a888808f8ef0a704b7594d445b6ed40
Parents: 14a41fa
Author: sathwik <[email protected]>
Authored: Fri May 10 16:06:10 2013 +0530
Committer: sathwik <[email protected]>
Committed: Fri May 10 16:06:10 2013 +0530

----------------------------------------------------------------------
 .../TestCorrelationJoin/CorrelationMultiTest.wsdl  |    2 +-
 .../apache/ode/bpel/compiler/bom/Expression.java   |    6 +++++-
 .../compiler/XPath20ExpressionCompilerImpl.java    |    2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ode/blob/2f2c7b56/axis2-war/src/test/resources/TestCorrelationJoin/CorrelationMultiTest.wsdl
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationJoin/CorrelationMultiTest.wsdl 
b/axis2-war/src/test/resources/TestCorrelationJoin/CorrelationMultiTest.wsdl
index eb4c4b1..b6d8439 100644
--- a/axis2-war/src/test/resources/TestCorrelationJoin/CorrelationMultiTest.wsdl
+++ b/axis2-war/src/test/resources/TestCorrelationJoin/CorrelationMultiTest.wsdl
@@ -113,7 +113,7 @@
     <prop:property name="testCorrelationID2" type="xsd:string"/>
     <prop:propertyAlias propertyName="tns:testCorrelationID2" 
messageType="tns:HeaderTestMessage" part="TestPart">
         <prop:query 
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
-            correlationID2
+            <![CDATA[correlationID2]]>
         </prop:query>
     </prop:propertyAlias>
 

http://git-wip-us.apache.org/repos/asf/ode/blob/2f2c7b56/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Expression.java
----------------------------------------------------------------------
diff --git 
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Expression.java 
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Expression.java
index ae0b9de..18ee68f 100644
--- 
a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Expression.java
+++ 
b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Expression.java
@@ -41,13 +41,17 @@ public class Expression extends BpelObject {
     
     public Node  getExpression(){
         getElement().normalize();
-        for (Node n = getElement().getFirstChild(); n != null; n = 
n.getNextSibling())
+        for (Node n = getElement().getFirstChild(); n != null; n = 
n.getNextSibling()) {
             switch (n.getNodeType()) {
             case Node.TEXT_NODE:
+                if(n.getNodeValue().trim().length() > 0) return n;
+                else if(n.getNextSibling() != null) continue;
+                else return n;
             case Node.ELEMENT_NODE:
             case Node.CDATA_SECTION_NODE:
                 return n;
             }
+        }
 
         return null;
     }

http://git-wip-us.apache.org/repos/asf/ode/blob/2f2c7b56/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
----------------------------------------------------------------------
diff --git 
a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
 
b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
index ca03574..ee543ab 100644
--- 
a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
+++ 
b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
@@ -146,7 +146,7 @@ public class XPath20ExpressionCompilerImpl implements 
ExpressionCompiler {
                     .getURI(), new QName(source.getElement().getNamespaceURI(),
                     source.getElement().getNodeName())));
         }
-        if (node.getNodeType() != Node.TEXT_NODE) {
+        if (node.getNodeType() != Node.TEXT_NODE && node.getNodeType() != 
Node.CDATA_SECTION_NODE) {
             throw new CompilationException(
                     __msgs.errUnexpectedNodeTypeForXPath(DOMUtils
                             .domToString(node)));

Reply via email to