Validates the element in the current context with the xsi:Type, xsi:Nil, xsi:SchemaLocation, and xsi:NoNamespaceSchemaLocation attribute values specified.
- localName
The local name of the element to validate.
- namespaceUri
The namespace URI of the element to validate.
- schemaInfo
An System.Xml.Schema.XmlSchemaInfo object whose properties are set on successful validation of the element's name. This parameter can be null.
- xsiType
The xsi:Type attribute value of the element. This parameter can be null.
- xsiNil
The xsi:Nil attribute value of the element. This parameter can be null.
- xsiSchemaLocation
The xsi:SchemaLocation attribute value of the element. This parameter can be null.
- xsiNoNamespaceSchemaLocation
The xsi:NoNamespaceSchemaLocation attribute value of the element. This parameter can be null.
The following are important notes to consider when using the XmlSchemaValidator.ValidateElement(string, string, XmlSchemaInfo, string, string, string, string) method.
If the element name is successfully validated in the current context, the System.Xml.Schema.XmlSchemaInfo object's (if specified) XmlSchemaInfo.IsNil, XmlSchemaInfo.SchemaType, XmlSchemaInfo.SchemaElement, and XmlSchemaInfo.Validity properties are set with the results of the validation.
If the element name or any of its attributes are invalid in the current context, the XmlSchemaInfo.Validity property is set to XmlSchemaValidity.Invalid; otherwise the XmlSchemaInfo.Validity property is set to XmlSchemaValidity.NotKnown.
If the XmlSchemaValidationFlags.ProcessSchemaLocation value was not passed as a parameter to the XmlSchemaValidator.#ctor(System.Xml.XmlNameTable, XmlSchemaSet, System.Xml.IXmlNamespaceResolver, XmlSchemaValidationFlags) constructor, xsi:SchemaLocation and xsi:NoNamespaceSchemaLocation attribute values are ignored.