Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 92563 invoked from network); 7 Jan 2010 08:49:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Jan 2010 08:49:43 -0000 Received: (qmail 76544 invoked by uid 500); 7 Jan 2010 08:49:43 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 76481 invoked by uid 500); 7 Jan 2010 08:49:43 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 76471 invoked by uid 99); 7 Jan 2010 08:49:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2010 08:49:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 209.85.211.175 as permitted sender) Received: from [209.85.211.175] (HELO mail-yw0-f175.google.com) (209.85.211.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2010 08:49:34 +0000 Received: by ywh5 with SMTP id 5so36354397ywh.11 for ; Thu, 07 Jan 2010 00:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=C6i9XYUP9eFeGylIMrgR8259awaVgJtlPNqe3GlNfTQ=; b=f/oG2rW9X1GIdCuQgWlmDZkvhMTOsPle59QWQbLSvVdWa1F4VBfuOyapj7yeJyUyFk D7DLHyFIdaGGJId5ZTDNt6SP6IzTRQqbVdMHelNbbPPXAyrm4A1SzrQT//CEe3Ylbi9e wMHnK2AVCwygp6iPmT7hnUzvXSqNysfrYcy8g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=ZiOB9E2PimAyeLq0MZr7i/FTr5FVYNkugAuJfVRN7XtubEfiCwWN0D8Y46QKLjtC/E KQy0dJCv0OCa2YtPf0tlRiUPFx4nT0yXR3tuLqedkR3WhUFEngn3I6sE4SNclW97goni n6j07HUM/8DZgZxJ2Ot/5awVkXYwanXYnP7Ac= Received: by 10.150.239.16 with SMTP id m16mr4951538ybh.289.1262854153198; Thu, 07 Jan 2010 00:49:13 -0800 (PST) Received: from ?192.168.0.158? ([125.34.8.144]) by mx.google.com with ESMTPS id 21sm20211652iwn.14.2010.01.07.00.49.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 07 Jan 2010 00:49:11 -0800 (PST) Message-ID: <4B45A002.5030405@gmail.com> Date: Thu, 07 Jan 2010 16:49:06 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: JAXB marshaller & control characters References: <4B3EC73C.4000604@gmail.com> <4B41B4FE.4070705@gmail.com> In-Reply-To: <4B41B4FE.4070705@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 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 >>>> >>> >> >> > >