Resolve External XML Resources Named by a URI
The XmlResolver is an abstract class that locates external XML resources that have been named by a URI. It is used to load XML documents, and to resolve external resources such as entities, DTDs or schemas, and import or include directives. The XmlResolver handles all aspects of negotiating the connection to the resources, including handling security credentials, opening the connection to the data source, and returning the resource in the form of a stream or other object type.
The .NET Framework includes two implementations of the XmlResolver class.
The XmlUrlResolver class is the default resolver for all classes in the System.Xml namespace. It supports the file:// and http:// protocols and requests from the WebRequest class. In many cases, if you do not specify an XmlResolver object that your application should use, an XmlUrlResolver object with no user credentials is used to access XML resources.
The XmlSecureResolver class helps to secure another XmlResolver object by wrapping the XmlResolver object and restricting the resources that the underlying XmlResolver has access to. For example, the XmlSecureResolver class can prohibit access to particular Internet sites or zones.
In This Section
Resolving Resources Using the XmlResolver
Discusses using the XmlResolver class.Supplying Authentication Credentials to XmlResolver when Reading from a File
Discusses how to supply authentication credentials.How to: Use the XmlSecureResolver Class
Discusses how to use the XmlSecureResolver to restrict access.
Related Sections
- Security and Your System.Xml Applications
Discusses security issues when working with XML technologies.