Partager via


Xsi:schemaLocation Attribute Binding Support 

The .NET Framework does not provide binding support for the xsi:schemaLocation attribute.

The XmlSerializer class ignores the xsi:schemaLocation attribute while deserializing an XML document into objects.

Explanation

The schemaLocation attribute is defined in the XML Schema instance namespace, http://www.w3.org/2001/XMLSchema-instance(commonly associated with the prefix xsi), and applies only to XML instance documents, not XML Schema documents. It is distinguished from the schemaLocation attribute defined in the XML Schema namespace, http://www.w3.org/2001/XMLSchema.

The xsi:schemaLocation attribute provides a way to locate the XML Schema definitions for namespaces defined in an XML instance document. Its value is a whitespace-delimited list of pairs of Uniform Resource Identifiers (URIs) where each pair consists of a namespace followed by the location of that namespace's XML Schema definition, which is typically an .xsd file.

The XmlSerializer class ignores the xsi:schemaLocation attribute while deserializing an XML document into objects. However, the XmlValidatingReader class, while validating an XML document, can use the attribute value to obtain XML Schema definitions. See Validation against XML Schema (XSD) with the XmlValidatingReader.

Possible containing elements: any instance element