System.Xml.XmlReader.Create Method

Creates a new System.Xml.XmlReader instance with the specified stream and System.Xml.XmlReaderSettings object.

Syntax

public static XmlReader Create (System.IO.Stream input, XmlReaderSettings settings)

Parameters

input
The stream containing the XML data.
settings
The System.Xml.XmlReaderSettings object used to configure the new System.Xml.XmlReader instance. This value can be null.

Returns

An System.Xml.XmlReader object to read the XML data.

Remarks

By default an System.Xml.XmlUrlResolver with no credentials is used to access any external resources such as a document type definition (DTD), entities, schemas, and so on. If the external resource is located on a network resource that requires authentication, use the XmlReaderSettings.XmlResolver property to specify an System.Xml.XmlResolver with the necessary credentials.

Note:

You can use one of the following methods to control which resources the System.Xml.XmlReader can access:

Restrict the resources that the System.Xml.XmlReader can access by setting the XmlReaderSettings.XmlResolver property to an System.Xml.XmlSecureResolver object.

-or-

Do not allow the System.Xml.XmlReader to open any external resources by setting the XmlReaderSettings.XmlResolver property to null.

The created System.Xml.XmlReader object expands entity references and performs XML normalization of new line characters.

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