Hi Jörg,

The spaces are preserved when I serialize using toXML method. When I check
with an editor I see the original indentation.

But when I use the following method xstream.fromXML(myXMLString) to
deserialize,
all the newlines and tabs characters are replaced by simple whitespaces
characters.

Is it more clear ?



> Hi Nicolas,
>
> Nicolas HERNANDEZ wrote:
>
>> Dear all,
>>
>> I would like to preserve the spaces after deserialization.
>>
>> I read that the substitution of newlines, tabs characters with spaces
>> is part of the XML specification [1].
>> I would prefer not to use xml entities as it is suggested.
>>
>> I also read that the XML recommendation offers a way to keep these
>> characters by using the special attribute xml:space="preserve".
>> Unfortunately it seems that no available parser accept it.
>> Is there one ? Any other idea by using converters may be ? Do I have to
>> implement my own parser ?
>>
>> Any suggestion will be welcome.
>
> Sorry, but I don't understand, what you are really up-to. White spaces in
> XML values *are* preserved, because they are part of an objects value.
> Apart
> from that you get an object (graph) as result and there's no equivalent
> for
> white spaces between Java objects ... ?!?
>
> Cheers,
> - Jörg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to