Advertisement

04.28.2008 at 09:06AM PDT, ID: 23359174
[x]
Attachment Details

XML ~ Write CR+LF   C#

Asked by zaratin in Extensible Markup Language (XML), C# Programming Language

Tags: C#

Hello all,
I am opening an XML file that contains line breaks. IWhen writing XML to a file I would like to preserve CR+LF as line break, without writing 
 to the file.
I am reading the contents into the momory by using XmlDocument and Method Load(). When saving the file I use the XmlTextWriter and XmlDocument method doc.Save([XmlTextWriter]).
Is it possible to avoid writing 
&#xA e.g. instead of  saving
...
<node attribute="test1 &#xD;&#xA; test2">
...

to save this

...
<node attribute="test1
                            test2">
...
Thanks

Start Free Trial
[+][-]04.28.2008 at 11:48AM PDT, ID: 21456535

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 04:33AM PDT, ID: 21461199

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Extensible Markup Language (XML), C# Programming Language
Tags: C#
Sign Up Now!
Solution Provided By: MogalManic
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628