Reading your reply carefully... if this is the role of the parser,
how can I change it's behavior?

On 3/16/2012 12:39 PM, Jörg Schaible wrote:
> Hi Bill,
> 
> Bill Schoolfield wrote:
> 
>> Hi I have a case where the special chars in an text element were
>> escaped as expected. But when the xml is reloaded, the reverse does
>> not happen.
>>
>> <item>...<test>...</item>
>>
>> Becomes
>>
>> <item>...&lt;test&gt;...</item>
>>
>> and remains that way after a round trip.
>>
>> What do I need to do to prevent this?
> 
> Actually I don't think that you can read or write the first version with 
> XStream at all. XStream will always escape those two characters in a String 
> and unescape them at deserialization. Actually the latter is already done by 
> the underlaying XML parser.
> 
> If you read XML with such a construct, you let XStream operate more or less 
> in undefined mode, because it's internal structures do not support mixed-
> mode XML. If "item" represents a String type, it depends on the parser what 
> happens when XStream requests for the text of the element.
> 
> - 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