MSDN Documentation

ValidationFlags Enum

Specifies flags that control the behavior of the XML Schema validation process.

Members

Remarks

The ValidationFlags enumeration is used with the XmlReaderSettings.ValidationFlags property to configure how XML schema validation is performed. Multiple flags can be combined using the bitwise OR operator (|).

Example Usage

The following code snippet demonstrates how to set validation flags on an XmlReaderSettings object:


using System.Xml;

// Create XmlReaderSettings
XmlReaderSettings settings = new XmlReaderSettings();

// Configure validation behavior
settings.ValidationType = ValidationType.Schema;
settings.ValidationFlags =
    ValidationFlags.ProcessSchemaLocation |
    ValidationFlags.ReportValidation |
    ValidationFlags.CheckCharacters;

// Create an XmlReader with the specified settings
using (XmlReader reader = XmlReader.Create("myDocument.xml", settings))
{
    while (reader.Read())
    {
        // Process the XML content
    }
}
            

See Also