473,386 Members | 1,698 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,386 software developers and data experts.

XmlDocument save and end tag formatting

Hi,

I am doing some work with the XmlDocument class for loading and saving files
and I notice that the save call is writing out the empty element in the
following format <element /> - is this formatting possible to control? ie.
get it to write out <element></element>.

Thanks

Donal
Nov 12 '05 #1
3 2632

"Donal McWeeney" <do************@NO-SP-AM.aimware.com> wrote in message
news:O0**************@TK2MSFTNGP10.phx.gbl...
Hi,
and I notice that the save call is writing out the empty element in the
following format <element /> - is this formatting possible to control? ie.
get it to write out <element></element>.


Why do you want to do that?

-djm
Nov 12 '05 #2
Donal McWeeney wrote:
I am doing some work with the XmlDocument class for loading and saving files
and I notice that the save call is writing out the empty element in the
following format <element /> - is this formatting possible to control? ie.
get it to write out <element></element>.


That's usually bad idea to rely on difference between these two forms,
because they are truly equivalent ones. Do you have some specific needs
or why do want to control such low level syntax sugar?

PS. You can try writing XML via XmlTextWriter with Formatting property
set to Formatting.Indented.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 12 '05 #3
> That's usually bad idea to rely on difference between these two forms,
because they are truly equivalent ones. Do you have some specific needs
or why do want to control such low level syntax sugar?


Agreed - next post on xml comparison tools would get around this - text file
comparison breaks this scenario.

Thanks

Donal
Nov 12 '05 #4

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

Similar topics

2
by: Tom Pearson | last post by:
I have created an XmlDocument and can see that this is correctly formed and has a root element If I Save the doc to a file and reload it all works o If I dump the doc to a stream, again using the...
5
by: KathyB | last post by:
If someone could just explain this to me...I just don't get it! I have an aspx page where I retrieve several session variables and use xmlDocument to transform xml file with xsl file into an...
13
by: Matthew Wieder | last post by:
In my C# application, I have class which has method that opens an XML document, modifies it and saves it out. I run that method for several different XML documents. What I've found is that the...
2
by: Donal McWeeney | last post by:
Hi, I am doing some work with the XmlDocument class for loading and saving files and I notice that the save call is writing out the empty element in the following format <element /> - is this...
2
by: Mike | last post by:
Hi, When using the following code: doc.PreserveWhitespace = true; doc.Save(fileName); where doc is a variable of type "XmlDocument", the XML file is saved with the correct information by the...
3
by: Aaron Sellers | last post by:
Hi all, I have a nicely formatted .xml file that loses that nice formatting when I edit it and use XmlDocument.Save to save the file. Does anyone know of any way to keep the formatting I had when...
3
by: RJA | last post by:
Hiyas, Using VS .net 2003. Setting up a Webservice that accepts 3rd party vendor designed XML requests and returns a filled XMLDocument with response data. Vendor XSDs were serialize into...
2
by: Mr Flibble | last post by:
Hey Folks. If I want to create a simple XMLDocument that contains a few lines of XML which class should I use? I'm a bit confused of the differences and which class to use and when. Ta.
3
by: Stephen Ward | last post by:
I have a simple little project open a xml file change a few nodes save the file, no big deal. The problem is that the doctype is getting modified when I save the file. So it looks like this:...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.