XmlReaderSettings Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Specifies a set of features to support on the XmlReader object created by the Create method.
Assembly: System.Xml (in System.Xml.dll)
The XmlReaderSettings type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | XmlReaderSettings() | Initializes a new instance of the XmlReaderSettings class. |
![]() | XmlReaderSettings(XmlResolver) | Initializes a new instance of the XmlReaderSettings class using a XmlResolver object. |
| Name | Description | |
|---|---|---|
![]() | Async | Gets or sets whether asynchronous XmlReader methods can be used on a particular XmlReader instance. |
![]() | CheckCharacters | Gets or sets a value indicating whether to do character checking. |
![]() | CloseInput | Gets or sets a value indicating whether the underlying stream or TextReader should be closed when the reader is closed. |
![]() | ConformanceLevel | Gets or sets the level of conformance which the XmlReader will comply. |
![]() | DtdProcessing | Gets or sets the DtdProcessing enumeration. |
![]() | IgnoreComments | Gets or sets a value indicating whether to ignore comments. |
![]() | IgnoreProcessingInstructions | Gets or sets a value indicating whether to ignore processing instructions. |
![]() | IgnoreWhitespace | Gets or sets a value indicating whether to ignore insignificant white space. |
![]() | LineNumberOffset | Gets or sets line number offset of the XmlReader object. |
![]() | LinePositionOffset | Gets or sets line position offset of the XmlReader object. |
![]() | MaxCharactersFromEntities | Gets or sets a value indicating the maximum allowable number of characters in a document that result from expanding entities. |
![]() | MaxCharactersInDocument | Gets or sets a value indicating the maximum allowable number of characters XML document. A zero (0) value means no limits on the size of the XML document. A non-zero value specifies the maximum size, in characters. |
![]() | NameTable | Gets or sets the XmlNameTable used for atomized string comparisons. |
![]() | XmlResolver | Sets the XmlResolver used to access external documents. |
| Name | Description | |
|---|---|---|
![]() | Clone | Creates a copy of the XmlReaderSettings 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 .NET Framework 2.0 release, the Create method is the preferred mechanism for obtaining XmlReader instances. The Create method uses the XmlReaderSettings class to specify which features to implement in the created XmlReader object.
Security Considerations
The following are things to consider when using the XmlReaderSettings class.
XmlReaderSettings objects can contain sensitive information such as user credentials. You should be careful when caching XmlReaderSettings objects, or when passing the XmlReaderSettings object from one component to another.
DTD processing is disabled by default. If you enable DTD processing, you need to be aware of including DTDs from untrusted sources and possible denial of service attacks.
Do not accept supporting components, such as NameTable, XmlNamespaceManager, and XmlResolver objects, from an untrusted source.
Memory usage of an application that uses XmlReader may have a correlation to the size of the parsed XML document. One form of denial of service attack is when excessively large XML documents are submitted to be parsed. You can limit the size of the document that can be parsed by setting the MaxCharactersInDocument property and then limit the number of characters that result from expanding entities by setting the MaxCharactersFromEntities property.


