I am creating an xml file using an XDocument. when i save this file it adds
<?xml version="1.0" encoding="utf-8"?>
at the top of xml ..
I want to exclude this before saving
How can i do this.
Using the save method in XmlWriter http://msdn.microsoft.com/en-us/library/bb336977.aspx and create this XmlWiter using XmlWriterSettings http://msdn.microsoft.com/en-us/library/system.xml .xmlwriter.settings.aspx
XmlWriterSettings settings = new XmlWriterSettings(); settings.OmitXmlDeclaration = true; XmlWriter writer = XmlWriter.Create(yourstream, settings); yourXDocument.Save(writer);
Source: https://habr.com/ru/post/1730867/More articles:Mysql php script to replace refactor needs - phpTinyMCE does not load when using jQuery - jqueryThe Origin of the Rectangle in CGRectMake - objective-cjquery tools - mouseover tabs - adding links - jqueryTortoise SVN Export Settings - version-controlNested dialing model: Insert Node at the end of SubNodes - sqlHow can I use unicode in the mailto protocol? - winapiEnable use of Core Data during development? - iphonemailto href not working in browser - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1730872/what-are-good-ways-to-architect-a-custom-claimsauthorizationmanager-windows-identity-foundation-class&usg=ALkJrhipdOoIo7bKaax6_vMxVGC2p2TWtQAll Articles