camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: [DISCUSS] XPath language improvements
Date Sat, 17 Dec 2011 09:52:53 GMT
On Fri, Dec 16, 2011 at 3:19 PM, Raul Kripalani <> wrote:
> Hi there,
> I'm working on, and since
> I'm touching the XPath Language, just wanted to check with the community if
> there is anything else that needs to be added/changed there.

Sometime the camel-scala DSL need changes as well.

> Claus suggested improving the Namespace support to make it easier for users
> to declare namespaces. Can someone briefly describe what kind of issues
> users are encountering, and any suggestions? (I don't recall having issues
> myself...).

If you have a XML structure with a namespce, then the XPath expression
must be bound to that namespace as well.
This is a common mistake.

<order xmlns="">

Then the xpath expression must use the htt:// namespace.

But what would have been cool, would be for Camel to be able to detect
if you do not have any namespace in the xpath expression.
And that the XML Structure have 1 namespace assigned in the root tag,
then we could auto default and use that namespace.

I have tried to look into this in the past if that was possible. But
the XPath API did not offer any way back then.

Another problem is we should possible add some more logging/tracing of
the evaluation process.
As when people get the xpath wrong, they do not know what is happening
and why its wrong.
And it can take some time to figure this out.

So if there was some way of enabling logging or just that we have more
DEBUG logging in the xpath builder then that is a good start.

> Anything else springs to mind?
> Regards,
> Raúl.

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message