System.Xml.XmlWriterSettings.OmitXmlDeclaration Property

Gets or sets a value indicating whether to omit an XML declaration.

Syntax

public bool OmitXmlDeclaration { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

This property only applies to System.Xml.XmlWriter instances that output text content; otherwise, this setting is ignored.

If XmlWriterSettings.OmitXmlDeclaration is set to false, The XML declaration is written automatically

The XML declaration is always written if XmlWriterSettings.ConformanceLevel is set to ConformanceLevel.Document, even if XmlWriterSettings.OmitXmlDeclaration is set to true.

The XML declaration is never written if XmlWriterSettings.ConformanceLevel is set to ConformanceLevel.Fragment. You can call XmlWriter.WriteProcessingInstruction(string, string) to explicitly write out an XML declaration.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0