Hi Jon If this works nicely we should add this to a FAQ entry for the JBI and Camel users.
Med venlig hilsen Claus Ibsen ...................................... Silverbullet Skovsgårdsvænget 21 8362 Hørning Tlf. +45 2962 7576 Web: www.silverbullet.dk -----Original Message----- From: Jonathan Anstey [mailto:[EMAIL PROTECTED] Sent: 11. september 2008 19:56 To: [email protected] Subject: Re: JBI Wrapper By Saxon SU, I'm assuming you mean http://servicemix.apache.org/servicemix-saxon.html ? You should be able to just use Camel this like: .transform().xquery("/jbi:message/jbi:part/can:IncomingMessage", m).to("validator:file:///<schemaLocation>") Given, of course, you have the camel-saxon component on your classpath. I'm not sure if you can do a similar selection with an XPath expression... raulvk wrote: > Hi, > > Thanks for the reply. > > Is there a way of doing it without having to construct an XSLT sheet + the > Saxon SU? By using XPath to SELECT the node-set that I want > > Thanks. > > > janstey wrote: > >> You can do this with the camel-saxon component. I've added a similar test >> at >> >> http://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryTransformTest.java >> >> raulvk wrote: >> >>> Hi, >>> >>> I am using Camel to control the flow of validation, transformation and >>> routing tasks that are applied to messages entering via ServiceMix CXF's >>> Binding Component. The CXF consumer endpoint sends the message >>> straightaway >>> to Camel. >>> >>> When validating the incoming message, I realized that it is surrounded by >>> the <jbi:message> wrapper. >>> How can I get rid of it so as to send the ACTUAL XML message to Camel's >>> validator? >>> >>> I have tried the following: >>> >>> - .setBody().xpath("//jbi:message/jbi:part/can:IncomingMessage", >>> m).to("validator:file:///<schemaLocation>") >>> >>> AND >>> . .transform().xpath("//jbi:message/jbi:part/can:IncomingMessage", >>> m).to("validator:file:///<schemaLocation>") >>> >>> m is bound to a HashMap containing the NameSpace mappings. >>> >>> However, the result is always an empty XML Body, which provokes an >>> exception >>> at the Validator. >>> >>> Is there an easy way of EXTRACTING the XML payload? >>> >>> Thank you. >>> >>> >> >> > >
