```html XmlSchemaIntegrityValidationWarningResult Class (System.Xml)

MSDN Documentation

System.Xml.XmlSchemaIntegrityValidationWarningResult

The XmlSchemaIntegrityValidationWarningResult class represents the result of a schema integrity validation warning that occurs when processing an XmlSchema. It provides details about the warning and allows developers to inspect the warning message, line number, position, and related schema object.

Namespace

System.Xml

Assembly

System.Xml.dll

Syntax
Properties
Methods
Examples
Remarks
public sealed class XmlSchemaIntegrityValidationWarningResult : XmlSchemaObject
{
    public string WarningMessage { get; }
    public int LineNumber { get; }
    public int LinePosition { get; }
    public XmlSchemaObject? SourceObject { get; }
    public XmlSchemaObject? RelatedObject { get; }
}
  • WarningMessage – The text of the warning.
  • LineNumber – The line in the schema file where the warning occurred.
  • LinePosition – The column position of the warning.
  • SourceObject – The XmlSchemaObject that generated the warning.
  • RelatedObject – The related schema object, if any.

The XmlSchemaIntegrityValidationWarningResult class does not expose additional methods beyond those inherited from XmlSchemaObject. It is primarily a data container.

using System;
using System.Xml;
using System.Xml.Schema;

class Program
{
    static void Main()
    {
        string xsd = @"
        <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
            <xs:element name='Root' type='xs:string'/>
            <xs:attribute name='Invalid' type='xs:string'/>