camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: JAXB marshaller & control characters
Date Sat, 02 Jan 2010 04:10:36 GMT
Hi,

I think you can write a type converter[1] which can turn the InputStream 
to a JAXB safe (which filters the control characters) InputStream.

Then can define your route like this

from("direct:start").covertTo(JaxbSafeInputStream.class).unmarshal(new 
JaxbDataFormat("org.apache.camel.example")).to("mock:endpoint");

If so I'd like to integrate it into camel-jaxb :)

[1] http://camel.apache.org/type-converter.html

Willem


Pavel wrote:
> I found a few relevant links:
> 
> http://old.nabble.com/UTF-8-characters-jaxb-td25531336.html#a25531336
> http://www.w3.org/TR/2004/REC-xml-20040204/#NT-Char
> 
> Seems like this topic was discussed already, but I'm not if relevant
> replacement mechanism made it into camel.
> 
> Pavel
> 
> On Thu, Dec 31, 2009 at 3:23 PM, Pavel <pagrus@gmail.com> wrote:
> 
>> Hi,
>>
>> I'm looking for the way to filter out control characters prohibited by XML
>> spec at/after marshalling. Otherwise consumers are unable to unmarshal the
>> content.
>>
>> Is there an out of the box means for doing that? If not, can you recommend
>> the right way for doing that?
>>
>> I just did similar exercise with CXF, there it was took creating custom
>> XMLStreamWriter and using outbound interceptor to replace original writer
>> with custom one.
>>
>> Thanks,
>> Pavel
>>
> 


Mime
View raw message