I just noticed that my BodyType is set to byte[]. Maybe it explains why the conversion to Dom produces a null? My messages are XML files dropped in a scanned folder and then picked-up by a route that forwards them into a JMS Topic where they are picked-up by my main route.
> -----Message d'origine----- > De : Claus Ibsen [mailto:claus.ib...@gmail.com] > Envoyé : vendredi 24 septembre 2010 14:55 > À : users@camel.apache.org > Objet : Re: can't tranform Body to DOM > > On Fri, Sep 24, 2010 at 2:48 PM, <patrice.god...@orange-ftgroup.com> > wrote: > > Hi, > > I receive JMS messages which are actually XML documents. > > In a processor I'm trying to get them as a DOM document since I need > to process them in a certain way. > > I'm doing this: > > org.w3c.dom.Document doc = > ex.getIn().getBody(org.w3c.dom.Document.class); > > > > And it does not seem to work (doc is always null). I don't get any > error message. > > I have xpath() statements in my route, which are being correctly > evaluated. > > I also have xslt transform endpoints which are working as expected. > > But here I need to replace an attribute value and I'd like to do > without xslt. > > > > use getMandatoryBody if you want Camel to barf if it could not convert > it. > > > > > Patrice > > > > > > ********************************* > > This message and any attachments (the "message") are confidential and > intended solely for the addressees. > > Any unauthorised use or dissemination is prohibited. > > Messages are susceptible to alteration. > > France Telecom Group shall not be liable for the message if altered, > changed or falsified. > > If you are not the intended addressee of this message, please cancel > it immediately and inform the sender. > > ******************************** > > > > > > > > -- > Claus Ibsen > Apache Camel Committer > > Author of Camel in Action: http://www.manning.com/ibsen/ > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus ********************************* This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. Messages are susceptible to alteration. France Telecom Group shall not be liable for the message if altered, changed or falsified. If you are not the intended addressee of this message, please cancel it immediately and inform the sender. ********************************