XML Serialization: serializing multiline strings?

  • Thread starter Thread starter nick.spacek
  • Start date Start date
N

nick.spacek

Hi everyone,
I'm trying to serialize a multiline string (coming from a textbox), but
after deserializing it it removes the newlines. Is there a way to
instruct the deserializer on how to handle the formatting it comes
across?

Thanks,
Nick
 
glenn said:
Nick

Try putting the data in a CDATA section.

HTH

Glenn

Alrighty, well since I read online that there was no way for the
XmlSerializer to write CDATA, I wrote it out with the XmlTextWriter.
The XML looks fine, the text is now wrapped in a CDATA element, but
using the stock deserializing, it doesn't pay attention to the newlines
in the CDATA.

Thanks for any help (thanks for your help already glenn),
Nick
 
Alrighty, well since I read online that there was no way for the
XmlSerializer to write CDATA, I wrote it out with the XmlTextWriter.
The XML looks fine, the text is now wrapped in a CDATA element, but
using the stock deserializing, it doesn't pay attention to the newlines
in the CDATA.

Thanks for any help (thanks for your help already glenn),
Nick

Nevermind, it is coming back with the newlines! Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top