コード例 #1
0
        public void ValidateOvalDefinitions(bool validateSchematron)
        {
            foreach (var definitionInfo in this.RequestedDefinitions)
            {
                var ovalDefinitionsXml = definitionInfo.Text;
                var ovalDefinitionsValidator = new OvalDefinitionsValidator(ovalDefinitionsXml, definitionInfo.Id);
                if (!ovalDefinitionsValidator.Schema.IsValid)
                    throw new OvalDefinitionsValidationException(ovalDefinitionsValidator.Schema.ErrorList);

                if (validateSchematron)
                {
                    var schematron = ovalDefinitionsValidator.ValidateSchematron();
                    if (!schematron.IsValid)
                        throw new OvalDefinitionsValidationException(schematron.ErrorList);
                }
            }
        }
コード例 #2
0
        public void ValidateOvalDefinitions(bool validateSchematron)
        {
            foreach (var definitionInfo in this.RequestedDefinitions)
            {
                var ovalDefinitionsXml       = definitionInfo.Text;
                var ovalDefinitionsValidator = new OvalDefinitionsValidator(ovalDefinitionsXml, definitionInfo.Id);
                if (!ovalDefinitionsValidator.Schema.IsValid)
                {
                    throw new OvalDefinitionsValidationException(ovalDefinitionsValidator.Schema.ErrorList);
                }

                if (validateSchematron)
                {
                    var schematron = ovalDefinitionsValidator.ValidateSchematron();
                    if (!schematron.IsValid)
                    {
                        throw new OvalDefinitionsValidationException(schematron.ErrorList);
                    }
                }
            }
        }