[
https://issues.apache.org/jira/browse/CAMEL-3697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999986#comment-12999986
]
Claus Ibsen commented on CAMEL-3697:
------------------------------------
Okay it requires a bit work to support additional expressions in the existing
languages. But I got this prototype up and running in Java DSL
{code}
from("direct:start").
filter().xpath(simple("/person[@name='${header.name}']")).
to("mock:result");
{code}
Notice how we use the simple language to construct the xpath expressions
string. For that you can use any of the languages, for example Groovy, etc.
> XPath expression should accept an expression to more easily allow dynamic
> XPath text to be defined in the DSL
> -------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-3697
> URL: https://issues.apache.org/jira/browse/CAMEL-3697
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.8.0
>
>
> See
> http://stackoverflow.com/questions/5067634/xpath-from-string
> In the ExpressionClause the xpath builder is only accepting a String as they
> XPath text. We should provide a method which accepts a Camel Expression as
> well.
> So you can do
> {code}
> .when().xpath(simple("/foo:${header.variable}")).to("mock:y")
> {code}
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira