Edit

Share via


XmlValidatingReader.XmlResolver Property

Definition

Sets the XmlResolver used for resolving external document type definition (DTD) and schema ___location references. The XmlResolver is also used to handle any import or include elements found in XML Schema definition language (XSD) schemas.

public:
 property System::Xml::XmlResolver ^ XmlResolver {  void set(System::Xml::XmlResolver ^ value); };
public System.Xml.XmlResolver XmlResolver { set; }
member this.XmlResolver : System.Xml.XmlResolver
Public Property XmlResolver As XmlResolver

Property Value

The XmlResolver to use. If set to null, external resources are not resolved.

In version 1.1 of the .NET Framework, the caller must be fully trusted to specify an XmlResolver.

Remarks

Note

The XmlValidatingReader class is obsolete in .NET Framework 2.0. You can create a validating XmlReader instance by using the XmlReaderSettings class and the Create method. For more information, see the Remarks section of the XmlReader reference page.

The XmlResolver is used to load any DTDs, entities, or schemas needed to complete the validation process.

This property can be set at any time and takes affect after the next Read call. If this property is set to null, the reader assumes the user is not interested in resolving external references. In this case, the reader only validates against internal resources, if the resource is present.

In version 1.1 of .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 null. External resources are not resolved.

When validating using schemas, you can avoid the expensive load process by providing an XmlSchemaCollection using the Schemas property.

Applies to

See also