System.Xml.XmlReader.Create Method

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

Syntax

public static XmlReader Create (string inputUri, XmlReaderSettings settings)

Parameters

inputUri
The URI for the file containing the XML data. The System.Xml.XmlResolver object on the System.Xml.XmlReaderSettings object is used to convert the path to a canonical data representation. If XmlReaderSettings.XmlResolver is null, a new System.Xml.XmlUrlResolver object is used.
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 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. This means that the System.Xml.XmlReader can access any locations that does not require authentication. 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 restrict the resources that the System.Xml.XmlReader can access by setting the XmlReaderSettings.XmlResolver property to an System.Xml.XmlSecureResolver object

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