camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: xpath and namespaces
Date Mon, 23 Apr 2012 16:29:58 GMT
Hi

Do you declare the route in an external file, or how do you refer to
the xml file with that route?
Maybe you can post your full XML files.


On Mon, Apr 23, 2012 at 6:23 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:
> I have an application where I load a camel context using spring and
> then add different spring dsl routes particular to individual site
> configurations.
>
> I am having trouble using an XPath splitter because of the issue with
> making namespaces visible to the XPath processor.
>
> I've seen from here
> (http://camel.465427.n5.nabble.com/fail-filter-XPATH-camel-td476424.html)
> that if the route is defined within a camel context, then you can make
> the namespace visible in the usual way, as a xmlns declaration in the
> root (context) element.
>
> But this doesn't seem to work if I am loading just a route into an
> existing context.
>
> <route xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns="http://camel.apache.org/schema/spring"
>  xmlns:d="http://dhis2.org/schema/dxf/2.0"
>  id="dataUpdater">
>
>  <description>Import Metadata</description>
>  <!-- every now and again ... -->
>  <from uri="quartz://halfminute?trigger.repeatInterval=300000&amp;trigger.repeatCount=10"/>
>  <to
>       uri="http://localhost/trunk/api/metaData.xml?"/>
>  <split>
>      <xpath>/d:/dxf2/d:organisationUnit</xpath>
>      <to .... />
>  </split>
>
> Camel complains that the xpath expression is illegal.  Has anyone come
> across (and maybe solved) this problem before?
>
> I've had a look at the tokenize xml approach, which seems nice (and
> efficient) but again it doesn't seem to handle namespaces.
>
> Any advice welcome.
>
> Regards
> Bob



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message