Updated Branches: refs/heads/master 69102e435 -> 79f121f3b
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/79f121f3 Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/79f121f3 Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/79f121f3 Branch: refs/heads/master Commit: 79f121f3b2d0224c35910fbf306609ebeb6b87b2 Parents: 69102e4 Author: sathwik <[email protected]> Authored: Fri May 10 15:21:54 2013 +0530 Committer: sathwik <[email protected]> Committed: Fri May 10 15:21:54 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/79f121f3/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/79f121f3/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 7137b55..808f89e 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/79f121f3/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 edb5d7a..dc35969 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 @@ -131,7 +131,7 @@ public class XPath20ExpressionCompilerImpl implements ExpressionCompiler { if (node == null) { throw new CompilationException(__msgs.errEmptyExpression(source.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))); } xpathStr = node.getNodeValue();
