Редагувати

Поділитися через


XmlReaderSettings Class

Definition

Specifies a set of features to support on the XmlReader object created by the Create method.

public ref class XmlReaderSettings sealed
public sealed class XmlReaderSettings
type XmlReaderSettings = class
Public NotInheritable Class XmlReaderSettings
Inheritance
XmlReaderSettings

Examples

The following example creates an XmlReader that uses an XmlUrlResolver with the necessary credentials.

// Create an XmlUrlResolver with the credentials necessary to access the Web server.
var resolver = new XmlUrlResolver();
var myCred = new NetworkCredential(UserName, SecurelyStoredPassword, Domain);
resolver.Credentials = myCred;

var settings = new XmlReaderSettings();
settings.XmlResolver = resolver;

// Create the reader.
XmlReader reader = XmlReader.Create("http://serverName/data/books.xml", settings);
' Create an XmlUrlResolver with the credentials necessary to access the Web server.
Dim resolver As New XmlUrlResolver()
Dim myCred As System.Net.NetworkCredential
myCred = New System.Net.NetworkCredential(UserName, SecurelyStoredPassword, Domain)
resolver.Credentials = myCred

Dim settings As New XmlReaderSettings()
settings.XmlResolver = resolver

' Create the reader.
Dim reader As XmlReader = XmlReader.Create("http://serverName/data/books.xml", settings)

Remarks

For more information about this API, see Supplemental API remarks for XmlReaderSettings.

Constructors

XmlReaderSettings()

Initializes a new instance of the XmlReaderSettings class.

XmlReaderSettings(XmlResolver)
Obsolete.

Initializes a new instance of the XmlReaderSettings class.

Properties

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 a value that determines the processing of DTDs.

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 in an 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.

ProhibitDtd
Obsolete.
Obsolete.

Gets or sets a value indicating whether to prohibit document type definition (DTD) processing. This property is obsolete. Use DtdProcessing instead.

Schemas

Gets or sets the XmlSchemaSet to use when performing schema validation.

ValidationFlags

Gets or sets a value indicating the schema validation settings. This setting applies to XmlReader objects that validate schemas (ValidationType property set to ValidationType.Schema).

ValidationType

Gets or sets a value indicating whether the XmlReader will perform validation or type assignment when reading.

XmlResolver

Sets the XmlResolver used to access external documents.

Methods

Clone()

Creates a copy of the XmlReaderSettings instance.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(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)

Events

ValidationEventHandler

Occurs when the reader encounters validation errors.

Applies to

See also