System.Xml.XmlReader.Create Method

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

Syntax

public static XmlReader Create (XmlReader reader, XmlReaderSettings settings)

Parameters

reader
The System.Xml.XmlReader object that you wish to use as the underlying reader.
settings
The System.Xml.XmlReaderSettings object used to configure the new System.Xml.XmlReader instance.

Returns

An System.Xml.XmlReader object that is wrapped around the specified System.Xml.XmlReader object.

Remarks

This method allows you add additional features to an underlying System.Xml.XmlReader object. The underlying System.Xml.XmlReader object can be another System.Xml.XmlReader object created by the erload:System.Xml.XmlReader.Create method, or an System.Xml.XmlReader object created using one of the concrete System.Xml.XmlReader implementations.

A default System.Xml.XmlUrlResolver with no credentials is used to access any external resources such as a schema. If the external resource is located on a network resource that requires authentication, specify an System.Xml.XmlResolver with the necessary credentials using the XmlReaderSettings.XmlResolver property.

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