Return-Path: Delivered-To: apmail-synapse-dev-archive@www.apache.org Received: (qmail 1360 invoked from network); 3 Apr 2009 08:01:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Apr 2009 08:01:25 -0000 Received: (qmail 7115 invoked by uid 500); 3 Apr 2009 08:01:25 -0000 Delivered-To: apmail-synapse-dev-archive@synapse.apache.org Received: (qmail 7007 invoked by uid 500); 3 Apr 2009 08:01:25 -0000 Mailing-List: contact dev-help@synapse.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@synapse.apache.org Delivered-To: mailing list dev@synapse.apache.org Received: (qmail 6999 invoked by uid 99); 3 Apr 2009 08:01:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 08:01:25 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andreas.veithen@gmail.com designates 209.85.219.170 as permitted sender) Received: from [209.85.219.170] (HELO mail-ew0-f170.google.com) (209.85.219.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 08:01:17 +0000 Received: by ewy18 with SMTP id 18so791932ewy.3 for ; Fri, 03 Apr 2009 01:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/ppEjEvtUncf16N/j3Vj2NczZUdFd1+iFnrXvoO7bPY=; b=HG99XtQfoN30L1FC6Ml0qr4DO64pgvUUJZgxXf0rM++/h1dmJ//Ve5Rt4l2JkF933Q TF2/S4vKOgLfDgLQCrgPI0rLR5B5RRG2m5JIB8A4KWKTI6gPkjgFqYpS7BYwI4xum2Cu muQXlELT5JyRyuJvUtx3lfnCRLfoAjWmSmz6w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Kr0Q1tTdkuanby73SLXIFp2pGeqSW5vz6MKjNWEvO4tFr7C2j0r+VJz1Ai95LRtv5W +dayFlzb6h054k8CvjMci7U3qg+wK5FnRLIm7Iqd4HSBt06Nllkr6EyBSC6ENNI20dVu OUsgX6cxkQxIFSMwZDx7JWatEGAyzL35F3rT4= MIME-Version: 1.0 Received: by 10.210.29.11 with SMTP id c11mr721896ebc.20.1238745655580; Fri, 03 Apr 2009 01:00:55 -0700 (PDT) In-Reply-To: <22862146.post@talk.nabble.com> References: <22841970.post@talk.nabble.com> <22862146.post@talk.nabble.com> Date: Fri, 3 Apr 2009 10:00:55 +0200 Message-ID: Subject: Re: VFS Text Files with spaces don't work. From: Andreas Veithen To: dev@synapse.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org This is not very convincing for several reasons: * An XML parser never removes whitespace. * A validating XML parser reports whitespace _between elements_ in a special way, but it is up to the application to decide what to do with it. Note that we are not talking about this type of whitespace here. * XSLT is not schema aware. * While space=3D"preserve" is defined in the XML specs it has no well defined semantics and it is up to the application to interpret it. * Axis2 and Synapse don't (or at least shouldn't) remove any whitespace. What you really need to do is to determine at what step in the mediation the whitespace is lost. Then we can try to understand why this is so. Andreas On Fri, Apr 3, 2009 at 07:19, kimhorn wrote: > > You are probably right. Haven't had time to look but I hope the payload > "text" element is defined as space=3D"preserve". If yes then its OK, If n= ot > then ? > > Any idea where is the =A0XSD is easily available ? > > It is probably one of the mediators removing the white space along the wa= y; > as XML does not preserve this. I will have to add in yet again more java = to > wrap the text field in CDATA "". As the recipient cannot change their XSD= , > this looks like the only option....Not sure XSLT will work unless target > name space also defines the element as space preserve ? > > My simple Synapse script is becoming a massive Java program. And I though= t > "wouldn't it be easy > to use a scripting tool like Synapse compared to writing Java code ". How > wrong. > > Thanks > Kim > > > > > Andreas Veithen-2 wrote: >> >> Are you sure that these spaces get trimmed inside the VFS transport >> and not somewhere in your mediation? Normally the plain text message >> builder is designed to strictly preserve the file content (including >> spaces), so this would be a serious bug. >> >> Andreas >> >> On Thu, Apr 2, 2009 at 08:52, kimhorn wrote: >>> >>> Run into a problem with VFS reading text files with fixed field length >>> fields, where empty fields are padded with spaces. There are a number o= f >>> B2B >>> formats that do this. >>> >>> If the empty fields are at the start or end of the file then when these >>> are >>> inserted into XML as Payload the >>> XML removes the spaces. The text should be wrapped in CDATA with double >>> Quotes to preserve this space data; but VFS does not do this. So the >>> fields >>> at start or end of file get lost and hence the whole file is now garbag= e. >>> >>> Hopefully reading them as binary files (not plan text) will get over th= is >>> ? >>> Other ideas ? >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/VFS-Text-Files-with-spaces-don%27t-work.-tp228419= 70p22841970.html >>> Sent from the Synapse - Dev mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org >>> For additional commands, e-mail: dev-help@synapse.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org >> For additional commands, e-mail: dev-help@synapse.apache.org >> >> >> > > -- > View this message in context: http://www.nabble.com/VFS-Text-Files-with-s= paces-don%27t-work.-tp22841970p22862146.html > Sent from the Synapse - Dev mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org > For additional commands, e-mail: dev-help@synapse.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org For additional commands, e-mail: dev-help@synapse.apache.org