System.Xml.XmlReader.Create Method

Creates a new System.Xml.XmlReader instance using the specified URI, System.Xml.XmlReaderSettings, and System.Xml.XmlParserContext objects.

Syntax

public static XmlReader Create (string inputUri, XmlReaderSettings settings, XmlParserContext inputContext)

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.
inputContext
The System.Xml.XmlParserContext object that provides the context information required to parse the XML fragment. The context information can include the System.Xml.XmlNameTable to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition.

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