synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <andreas.veit...@gmail.com>
Subject Re: VFS Text Files with spaces don't work.
Date Fri, 03 Apr 2009 08:00:55 GMT
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="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 <kim.horn@icsglobal.net> wrote:
>
> You are probably right. Haven't had time to look but I hope the payload
> "text" element is defined as space="preserve". If yes then its OK, If not
> then ?
>
> Any idea where is the  XSD is easily available ?
>
> It is probably one of the mediators removing the white space along the way;
> 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 thought
> "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 <kim.horn@icsglobal.net> 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 of
>>> 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 garbage.
>>>
>>> Hopefully reading them as binary files (not plan text) will get over this
>>> ?
>>> Other ideas ?
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/VFS-Text-Files-with-spaces-don%27t-work.-tp22841970p22841970.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-spaces-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


Mime
View raw message