I am creating a Xml like format using XmlWriter
. But in the output there is version information also.
<?xml version="1.0" encoding="utf-8"?>
I don't need this in my file. How can I do that? Is there any way to remove it by code?
In the XML Files explorer, right-click the XML file or XML element that you want to remove and click Delete.
Using XML files is advantageous for many reasons including: Readability: For a data analyst, the data must be easily accessible and readable. XML files are easy to comprehend because they use human language with actual words instead of a computer language. For example, XML tag names clearly define and explain the data.
yes you can delete xml files, but you have to be careful and this is not recommended. But, You cannot get rid of manifest xml file. You can get more help in this previous question.. stackoverflow.com/questions/8037203/…
Use the ConformanceLevel
and OmitXmlDeclaration
properties. Example:
XmlWriter w;
w.Settings = new XmlWriterSettings();
w.Settings.ConformanceLevel = ConformanceLevel.Fragment;
w.Settings.OmitXmlDeclaration = true;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With