Hi You cannot do that, as its not supported by the xpath expression api that comes with java. Many before you have tried. You can google/search the web about this.
Though you can use local-name() in the xpath expression, then you can avoid the namespace prefix binding. But it clutters the xpath stil. On Fri, Nov 1, 2013 at 4:29 PM, toomanyedwards <[email protected]> wrote: > I thought I made it clear in my original question, but I guess not. What I'm > trying to is *not* have to specify in my xpath. > > /nsprefix:book/nsprefix:chapter is extremely cluttered and redundant. > > It be much better if we could just specify: > > /book/chapter and tell the processor what the default namespace should be > for elements that don't have a prefix. > > This is effectively what you can do in an xml document like this: > > <?xml version="1.0" encoding="UTF-8"?> > <book xmlns="http://mydomain.com"> > <chapter>some text</chapter> > </book> > > > It'd be great to be able to do it an xpath as well. Thanks for your reply, > but no where in the camel docs does it show how to this. > > Please point to where if you think it does. > http://camel.apache.org/xpath.html does describe how to do this. > > -edward > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-can-I-avoid-setting-namespace-prefixes-in-xpath-expressions-in-camel-tp5742461p5742509.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
