you can set the namespace prefixes at route level and just use the prefix
anywhere in that route.

off the top of my head I don't know the java DSL for it, but in xml you do:

<route id="myroute" xmlns:nsprefix="http://mydomain.com";>
...
<setHeader headerName="my_header">
        <xpath
resultType="java.lang.String">/nsprefix:book/nsprefix:chapter</xpath>
</setHeader>
...
</route>


and of course you can specify multiple namespaces



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-can-I-avoid-setting-namespace-prefixes-in-xpath-expressions-in-camel-tp5742461p5742467.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to