XML save issue in .NET

  • Thread starter Thread starter Amendra
  • Start date Start date
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.
 
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.
 
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.
 
Dear friends,

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

Abs,
Daniel Neto
 
Back
Top