Here is away to do the job by using the Java DSL.
You can find an unit test for it here[1]

[1] https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathNamespaceResultTypeTest.java

Willem

On 2/17/11 7:32 AM, tecoripa wrote:

Unfortunately, no.  I've been wrestling with a similar issue all day long.
The atom messages I receive set the default namespace, i.e.:

<entry xmlns="http://purl.org/atom/ns#";>
...
</entry>

and although I no longer get the XPath error, my xpath expressions don't get
resolved -- results are always null.

The expression "/atom:entry/atom:title" throws an error, since the namespace
prefix does not get inherited from my root<beans xlmns:atom=...>
declaration. The expression "/entry/title" gets parsed correctly, but never
results in a match.

If you find a solution, please post it.  I suspect declaring the namespace
in the<camelContext>  element results in the Namespace being set under the
hood when processing that element's tree, but no such processing takes place
for the<routeContext>  tag.  I'm going to try a few more things out, then
roll up my sleeves and take a look at the source code.



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com

Reply via email to