XmlWriterSettings Class
Specifies a set of features to support on the XmlWriter object created by the XmlWriter.Create method.
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
The XmlWriterSettings type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | CheckCharacters | Gets or sets a value indicating whether to do character checking. |
![]() ![]() ![]() | CloseOutput | Gets or sets a value indicating whether the XmlWriter should also close the underlying stream or TextWriter when the Close method is called. |
![]() ![]() ![]() | ConformanceLevel | Gets or sets the level of conformance which the XmlWriter complies with. |
![]() ![]() ![]() | Encoding | Gets or sets the text encoding to use. |
![]() ![]() ![]() | Indent | Gets or sets a value indicating whether to indent elements. |
![]() ![]() ![]() | IndentChars | Gets or sets the character string to use when indenting. This setting is used when the Indent property is set to true. |
![]() ![]() ![]() | NamespaceHandling | Gets or sets the NamespaceHandling enumeration used to specify whether to remove duplicate namespace declarations in the XmlWriter. For the duplicate namespace to be removed, the prefix and the namespace have to match. |
![]() ![]() ![]() | NewLineChars | Gets or sets the character string to use for line breaks. |
![]() ![]() ![]() | NewLineHandling | Gets or sets a value indicating whether to normalize line breaks in the output. |
![]() ![]() ![]() | NewLineOnAttributes | Gets or sets a value indicating whether to write attributes on a new line. |
![]() ![]() ![]() | OmitXmlDeclaration | Gets or sets a value indicating whether to write an XML declaration. |
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | Clone | Creates a copy of the XmlWriterSettings instance. |
![]() ![]() ![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() ![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() ![]() | Reset | Resets the members of the settings class to their default values. |
![]() ![]() ![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
In the Microsoft .NET Framework 2.0 release, the Create method is the preferred mechanism for obtaining XmlWriter instances. The Create method uses the XmlWriterSettings class to specify which features to implement in the created XmlWriter object.
For more information and code examples, see XML Data.
Dim output As New StringBuilder() Dim settings As New XmlWriterSettings() settings.Indent = True settings.OmitXmlDeclaration = True settings.NewLineOnAttributes = True Using writer As XmlWriter = XmlWriter.Create(output, settings) writer.WriteStartElement("order") writer.WriteAttributeString("orderID", "367A54") writer.WriteAttributeString("date", "2001-05-03") writer.WriteElementString("price", "19.95") writer.WriteEndElement() writer.Flush() End Using OutputTextBlock.Text = output.ToString()
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.




