private static void CheckValidation(IXPathNavigable xml)
        {
            var schema = XmlValidator.LoadFromManifestResource(Assembly.GetExecutingAssembly(), ContentListDefinitionSchemaManifestResourceName);

            if (!schema.Validate(xml))
            {
                if (schema.Errors.Count == 0)
                {
                    throw new ContentRegistrationException(SR.Exceptions.Registration.Msg_InvalidContentListDefinitionXml);
                }
                else
                {
                    throw new ContentRegistrationException(String.Concat(
                                                               SR.Exceptions.Registration.Msg_InvalidContentListDefinitionXml, ": ", schema.Errors[0].Exception.Message),
                                                           schema.Errors[0].Exception);
                }
            }
        }
Exemple #2
0
        private static void CheckValidation(IXPathNavigable xml)
        {
            var schema = XmlValidator.LoadFromManifestResource(Assembly.GetExecutingAssembly(), NodeQuerySchemaManifestResourceName);

            if (!schema.Validate(xml))
            {
                if (schema.Errors.Count == 0)
                {
                    throw new InvalidOperationException(SR.Exceptions.Search.Msg_InvalidNodeQueryXml);
                }
                else
                {
                    throw new InvalidOperationException(String.Concat(
                                                            SR.Exceptions.Search.Msg_InvalidNodeQueryXml, ": ", schema.Errors[0].Exception.Message),
                                                        schema.Errors[0].Exception);
                }
            }
        }