camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SteveSmall <st...@xfact.com>
Subject Re: Camel, Spring, routeContextRef and namespaces?
Date Wed, 16 Feb 2011 22:00:50 GMT

I have the same exact issue, but need a different solution. What happens if
you have 2 paths with different namespaces that can both be resolved using
the same XPath expression? For example:

/a:body/a:element/a:child
/a:body/b:element/a:child

Using "/body/element/child" can't differentiate between the two in the event
that this scenario occurs.

In my scenario, I need to resolve an XPath expression that can be used on
several XML files. The tag names on these paths can be slightly different,
but the namespaces make the path unique. The expression (which works in
CamelContext just fine) is similar to "a:*/a:*/a:*/a:TagName". This allows
me to check for multiple paths without having to use excessive logic in the
route such as:

a:request/a:header/a:element/a:subelement
a:response/a:header/a:element/a:subelement
a:data/a:header/a:element/a:subelement

While omitting the namespaces from the path works (i.e. "*/*/*/TagName"),
have you come across a way to keep them in the XPath without throwing this
exception?

Thanks.

-Steve
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Spring-routeContextRef-and-namespaces-tp3386814p3388473.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message