[ 
https://issues.apache.org/jira/browse/CAMEL-3531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981131#action_12981131
 ] 

Craig McDaniel commented on CAMEL-3531:
---------------------------------------

>From what I can tell so far, the same method is being used for both the 
>splitter and when/filter. The first message hits the //hello XPath expression 
>and returns a NodeList of size 1, the message goes to mock:english. The second 
>and third messages hit the //hello XPath and return a NodeList of size 0. I'm 
>guessing since this is not a Boolean, it is assuming a non-null result is 
>true. I'm not sure yet how to patch this. 

> xpath not working together with choice/when
> -------------------------------------------
>
>                 Key: CAMEL-3531
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3531
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-scala
>    Affects Versions: 2.5.0
>         Environment: Ubuntu Linux 10.04, java 1.6
>            Reporter: Craig McDaniel
>         Attachments: XPathContentBasedRouterTest.scala
>
>
> When using the Scala DSL, xpath expressions inside when() do not work as 
> expected. As an example:
> {code:none}
>      "direct:a" ==> {
>      choice {
>         when (xpath("//hello")) to ("mock:english")
>         when (xpath("//hallo")) {
>           to ("mock:dutch")
>           to ("mock:german")
>         } 
>         otherwise to ("mock:french")
>       }
>     }
> // Send messages
> "direct:a" ! ("<hello/>", "<hallo/>", "<hellos/>")
> {code}
> Here we should receive 1 message in each of the mocks. For whatever reason, 
> all 3 messages go to mock:english. Similar routes work as expected with the 
> Java DSL. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to