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 Thu, 07 Jan 2010 08:49:06 GMT
Hi Pavel,

I committed the patch for CAMEL-2330, You can find the JaxbFilterReader 
code here[1].
Please check out last Apache Camel 2.2-SNAPSHOT to verify it.

[1] 
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbFilterReader.java

Willem

Willem Jiang wrote:
> I just filled a JIRA[1] for adding an out of box support in camel-jaxb.
> So you don't need to use covertTo() DSL any more.
> 
> [1] https://issues.apache.org/activemq/browse/CAMEL-2330
> 
> Willem
> 
> 
> Willem Jiang wrote:
>> 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