On Jul 23, 2014, at 12:35 PM, Lowry <[email protected]> wrote:

> The CXF transformation feature provides a nice way to declaratively specifiy
> certain simple transformations, element names, adds elements, changes
> namespace, etc. It makes it easy to describe the transformation in a map in
> Spring XML. I haven't found anything similar to declare transformation with
> Apache Camel. I tried using CXF xformation feature with camel but found to
> be tightly tied to the CXF endpoint rather any arbitrary location within a
> camel route. So, would it be difficult to write a camel component that
> possibly re-uses CXF code "org.apache.cxf.feature.StaxTransformFeature" and
> underlying code  ?

It shouldn’t be too hard.  In camel, you should be able to do a 
convertBodyTo(XMLStreamReader.class) or message.getBody(XMLStreamReader.class) 
or similar and then call the 
org.apache.cxf.staxutils.transform.InTransformReader constructor with the 
appropriate maps.   I don’t think anything in 
org.apache.cfx.staxutils.transform has any dependency on any of the endpoint 
settings, annotations, etc… 

Simple thing might be to create a Processor in Camel that would do much the 
same as the transformationFeature stuff in CXF.   Would take a couple Maps of 
properties and wrappers the XMLStreamReader/Writers.   You could then easily 
configure that processor on the route.


-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to