Hi

I do see value in having an xpath function in the simple language, as
people are still doing alot of messaging with xml payloads.

We could try experiment with adding the xpath function that supports

xpath(xpathExp)

Its the result type that could be tricky as xpath returns a NodeSet by default.
I guess usually you want to grab a single element and have its value
returned as a String, like grabbing an attribute or content of a node.
Or evaluate it as a boolean.

So we may need a 2nd parameter to indicate the result type of a value of
- boolean
- String

xpath(xpathExp, resultType)

And then there is the namespace mapping. Maybe we can have 3 parameter
for optional namespace mappings, separated by comma

xpath(xpathExp, resultType, "ns2=http://com.foo/wine,ns3=http://com.foo/beer";)

But as you can see this syntax is somewhat complicated and thus not so
easy to implement and for end users to understand.

Though XML and XPath are still often used. So it could be nice with an
xpath function in the simple language.

PS: For composite expression in Java you can use ExpressionBuilder and
PredicateBuilder to combine them. So you can do it there.



On Sat, Sep 21, 2013 at 9:29 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:
> Hi
>
> Hold your horses ... Camels.
>
> It can get too confusing and complex syntax if you can inline any
> other kind of languages in the simple language. Syntax parsers and
> whatnot cannot validate and parse the other languages syntax etc. The
> name of the language is simple, so lets try to keep it that way.
>
> Also with xpath there is the namepsace problem, and as well to define
> a result type etc.
>
>
>
>
>
>
> On Fri, Sep 20, 2013 at 11:39 PM, Christian Posta
> <christian.po...@gmail.com> wrote:
>> yah i like that. can you open a jira?
>>
>>
>> On Fri, Sep 20, 2013 at 9:36 AM, Dale King <dalewk...@gmail.com> wrote:
>>
>>> Perhaps adding language prefixes so that things like ${xpath:...} or
>>> ${ognl:...} and similar would work.
>>>
>>>
>>> On Fri, Sep 20, 2013 at 11:17 AM, bonnahu <bonn...@gmail.com> wrote:
>>>
>>> > Hi Christian,
>>> > I think it would be useful if we have such  "composite" expression. What
>>> do
>>> > you think?
>>> >
>>> >
>>> >
>>> > --
>>> > View this message in context:
>>> >
>>> http://camel.465427.n5.nabble.com/Is-it-possible-to-include-XPath-expression-in-simple-expression-tp5739830p5739882.html
>>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>>> >
>>>
>>>
>>>
>>> --
>>> Dale King
>>>
>>
>>
>>
>> --
>> *Christian Posta*
>> http://www.christianposta.com/blog
>> twitter: @christianposta
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to