- schemaInfo
- An System.Xml.Schema.XmlSchemaInfo object whose properties are set on successful validation of the text content of the element. This parameter can be null.
- typedValue
- The typed text content of the element.
The parsed, typed simple content of the element.
If you are validating against the xs:key, xs:keyref, or xs:unique identity constraints, do not use the XmlSchemaValidator.ValidateEndElement(XmlSchemaInfo, object) method overload. Instead, call the erload:System.Xml.Schema.XmlSchemaValidator.ValidateText method and pass it the value of the element. Then call the XmlSchemaValidator.ValidateEndElement(XmlSchemaInfo) method overload, which takes System.Xml.Schema.XmlSchemaInfo as an argument, to verify that the text content of the element is valid according to its data type.
The following are important notes to consider when using the XmlSchemaValidator.ValidateEndElement(XmlSchemaInfo, object) method.
For elements with simple content, the XmlSchemaValidator.ValidateEndElement(XmlSchemaInfo, object) method verifies that the text content of the element is valid according to its data type and returns the parsed typed value. The text content of the element is obtained from the typed content passed as a parameter.
If calls to the erload:System.Xml.Schema.XmlSchemaValidator.ValidateText method have been previously made, an InvalidOperationException is thrown.
If the element has complex content an InvalidOperationException is thrown.
If the System.Xml.Schema.XmlSchemaValidator object was constructed with the XmlSchemaValidationFlags.ProcessIdentityConstraints value as a parameter, the XmlSchemaValidator.ValidateEndElement(XmlSchemaInfo, object) method checks the identity constraint rules (if any) that apply to the element.
If the element is successfully validated in the current context, the System.Xml.Schema.XmlSchemaInfo object's (if specified) XmlSchemaInfo.IsDefault, XmlSchemaInfo.MemberType, and XmlSchemaInfo.Validity properties are set with the results of the validation.