camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmoulliard <cmoulli...@gmail.com>
Subject Re: Xpath Prefix NameSpace Error !
Date Tue, 08 Jul 2008 14:02:15 GMT

I found the error . The issue comes from the fact that I try to setHeader
with xpath("") without adding Namespaces object.

So when I use the following code 

.setHeader("CompanyName").xpath("//SwInt:Requestor/text()", ns)

everything is ok

Thxs for your help.

:clap:


James.Strachan wrote:
> 
> 2008/7/8 James Strachan <james.strachan@gmail.com>:
>> What happens if you uncommend the Namespaces line? FWIW you have to
>> define namespace prefixes to use XPath effectively with namespaced XML
> 
> You need to actually use the Namespaces object to create your xpath
> expression.
> 
> when(ns.xpath("..."))
> 
> or
> 
> when.xpath("...", ns)
> 
> etc
> 
> otherwise the namespace prefixes associated with the Namespaces object
> will not be passed into the xpath expression (hence your error)
> 
> See the namespaces section...
> http://activemq.apache.org/camel/xpath.html
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Xpath-Prefix-NameSpace-Error-%21-tp18338783s22882p18339987.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message