Пример #1
0
        private bool ValidateMatchesOneOfElement(SchemaOneOfElement schemaOneOfElement, List <Match> input)
        {
            foreach (var option in schemaOneOfElement.Options)
            {
                if (ValidateMatches(option, input))
                {
                    return(true);
                }
            }

            ErrorMessage = "Element does not match neither of allowed options.";
            return(false);
        }
Пример #2
0
        private bool ValidateMatchesOneOfElement(SchemaOneOfElement schemaOneOfElement, Match input, string attributeName = null)           // only nodes and literals
        {
            var fullMessage = "";

            foreach (var option in schemaOneOfElement.Options)
            {
                if (ValidateMatches(option, input, attributeName))
                {
                    return(true);
                }

                fullMessage += "\t" + ErrorMessage.Replace("\n", "\n\t") + "\n";
            }

            ErrorMessage = "Element '" + input.Path + "' does not match neither of allowed options:\n" + fullMessage;
            return(false);
        }