473,387 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

XML save issue in .NET

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.

Nov 15 '05 #1
4 1232
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.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 15 '05 #2
Is this the only solution.. :(
"Oleg Tkachenko" <oleg@NO_!SPAM!_PLEASEtkachenko.com> wrote in message
news:ew**************@TK2MSFTNGP11.phx.gbl...
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.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 15 '05 #3
Set IsEmpty on XmlElement to true.

"Amendra" <am*****@virtusa.com> wrote in message
news:uh****************@tk2msftngp13.phx.gbl...
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.

Nov 15 '05 #4
Dear friends,

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

Abs,
Daniel Neto

"Amendra" <am*****@virtusa.com> escreveu na mensagem
news:uh****************@tk2msftngp13.phx.gbl...
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.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kit Truong | last post by:
Hello, I have an asp page that produces output from a database. This allows a simple way for the user to save the data to a text file by going to File->Save as... The default save as options...
27
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I...
4
by: Amendra | last post by:
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...
0
by: Amendra | last post by:
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...
2
by: icedgar | last post by:
am using the following script in the BeforeUpdate area of a main form. Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strMsg As String strMsg = "Do you wish to save your changes?" If...
22
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
2
by: Ada | last post by:
First of all, I thought this might be a directory security issue but it's not. I was able to upload the file to the directory via HTTP. Here's the situation. I have a JPG file on my server....
4
by: tarafinlay | last post by:
Hi all, I am new to access and am finding it a bit unintuitive having worked with SQL server in the past... And I am in a bit of a hurry because my employer wants me to crank something out which...
1
by: Shannon Richards | last post by:
Hello All: I have implemented a custom configuration section in my app.config file as follows: <configSections> <section name="AdminUIConfig" type="TestMgr.UIConfigSection,TestMgr"/>...
7
by: dmagoo22 | last post by:
I have inherited a program in which I'm finding that Access is running strangely. I broke the entire function into multiple macros as the reports would fail. It seems that when the DoCmd.OpenReport...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.