Note: |
|---|
In the
.NET Framework version 2.0 release, the recommended practice is to create XmlReader instances using the XmlReader..::.Create method. This allows you to take full advantage of the new features introduced in this release. For more information, see Creating XML Readers.
|
The reader uses XmlResolver to resolve the location of the file loaded into the reader and also to resolve DTD references. For example, if your XML included the DOCTYPE declaration, <!DOCTYPE book SYSTEM book.dtd> the reader resolves this external file and ensures that the DTD is well-formed. The reader does not use the DTD for validation.
This property can be changed at any time and takes effect on the next read operation. If this property is set to nullNothingnullptra null reference (Nothing in Visual Basic), any external DTD references encountered by the reader are not resolved.
In version 1.1 of the .NET Framework, if this property is not set, the trust level of the application determines the default behavior.
Fully trusted code: The reader uses a default XmlUrlResolver with no user credentials. If authentication is required to access a network resource, use the XmlResolver property to specify an XmlResolver with the necessary credentials.
Semi-trusted code: The XmlResolver property is set to nullNothingnullptra null reference (Nothing in Visual Basic). External resources are not resolved.