camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-3155) Default namespace not handled by .when(xpath(string))
Date Sun, 26 Sep 2010 05:36:40 GMT


Claus Ibsen commented on CAMEL-3155:

And no I could not find a solution with the XPath API to let it be aware of the default namesapce.
There seems to be no good hooks for such kind.

Even if I added what may be a default namespace to the NamespaceContext the xpath would still
fail. The only solution I could get working is to use namespace prefixes in the xpath expressions.

And the XPathExpression does not offer any callbacks or hooks to influence the compiling.
And I bet doing a string based manipulation of the given String for the namespace is hard
because people can use a lot of different combinations.

So if you have a simple expression like

Then it may be possible to manipulate it beforehand and do

And register c as a namespace with the uri from the XML message.

But when the xpath expression becomes more complex, its much harder.

So I wonder there must be better ways that this?

> Default namespace not handled by .when(xpath(string))
> -----------------------------------------------------
>                 Key: CAMEL-3155
>                 URL:
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.4.0
>         Environment: Apache Maven 3.0-alpha-5 (r883378; 2009-11-23 07:53:41-0800)
> Java version: 1.6.0_17
> Java home: C:\Program Files\Java\jdk1.6.0_17\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7" version: "6.1" arch: "x86" Family: "windows"
>            Reporter: Malachi de AElfweald
>            Assignee: Claus Ibsen
>            Priority: Minor
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
> If I do a .choice().when(xpath("//rootnode")) it fails to find any matches unless I preprocess
and remove the xmlns="blah" (autogenerated by JAXB on the other end)

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

View raw message