XML save issue in .NET

A

Amendra

Hi,

Currently we are using the .NET XMLDocument Class to manipulate some xml
documents. The issue we are having is that when we save the XML files using
the classes save method, empty xml tags will be saved with a CRLF instead of
the empty value. This can be solved by setting the PreserveWhiteSpace
property to true. But then the indentation is lost.

E.g.:-
Before Saving this is how the tags are.

<Test></Test>

After saving

<Test>
</Test>


Has anybody come across this, is there any solution for this.

Thanks
Amendra.
 
O

Oleg Tkachenko

Amendra wrote:

Currently we are using the .NET XMLDocument Class to manipulate some xml
documents. The issue we are having is that when we save the XML files using
the classes save method, empty xml tags will be saved with a CRLF instead of
the empty value. This can be solved by setting the PreserveWhiteSpace
property to true. But then the indentation is lost.

You have to choose what to preserve - either indentation of whitespace.
Alternatively implement your own indentation algorithm.
 
A

Amendra

Is this the only solution.. :(


Oleg Tkachenko said:
Amendra wrote:



You have to choose what to preserve - either indentation of whitespace.
Alternatively implement your own indentation algorithm.
 
D

Daniel Neto

Dear friends,

This groups is an Brasilian Group, in Portuguese Language all rights??!!!

Abs,
Daniel Neto
 

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

Top