GetManifestSchemaSet() public static method

public static GetManifestSchemaSet ( string schemaNamespace ) : XmlSchemaSet
schemaNamespace string
return System.Xml.Schema.XmlSchemaSet
Exemplo n.º 1
0
        private static void ValidateManifestSchema(XDocument document, string schemaNamespace)
        {
            XmlSchemaSet manifestSchemaSet = ManifestSchemaUtility.GetManifestSchemaSet(schemaNamespace);

            document.Validate(manifestSchemaSet, delegate(object sender, ValidationEventArgs e) {
                if (e.Severity == XmlSeverityType.Error)
                {
                    throw new InvalidOperationException(e.Message);
                }
            });
        }
Exemplo n.º 2
0
        private static void ValidateManifestSchema(XDocument document, string schemaNamespace)
        {
            var schemaSet = ManifestSchemaUtility.GetManifestSchemaSet(schemaNamespace);

            document.Validate(schemaSet, (sender, e) =>
            {
                if (e.Severity == XmlSeverityType.Error)
                {
                    // Throw an exception if there is a validation error
                    throw new InvalidOperationException(e.Message);
                }
            });
        }