Пример #1
0
        private bool ValidateMatchesSequenceElement(SchemaSequenceElement schemaSequenceElement, Match input, string attributeName = null)           // no sequences
        {
            if (schemaSequenceElement.Sequence.Count > 1)
            {
                ErrorMessage = "A sequence of " + schemaSequenceElement.Sequence.Count + " elements expected, one element found.";
                return(false);
            }

            return(ValidateMatches(schemaSequenceElement.Sequence[0], input, attributeName));
        }
Пример #2
0
        private bool ValidateMatchesSequenceElement(SchemaSequenceElement schemaSequenceElement, List <Match> input)
        {
            var l = schemaSequenceElement.Sequence.Count;

            if (input.Count != l)
            {
                ErrorMessage = "A sequence of " + l + " elements expected, " + input.Count + " element(s) found.";
                return(false);
            }

            for (var i = 0; i < l; ++i)
            {
                if (!ValidateMatches(schemaSequenceElement.Sequence[i], input[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #3
0
 private bool ValidateMatchesSequenceElementPartial(SchemaSequenceElement schemaSequenceElement, Match input, string attributeName = null)           // no sequences
 // only one element found, but it could be the first in sequence,
 // so check that it partially matches schema of first element in the sequence
 {
     return(ValidateMatchesPartial(schemaSequenceElement.Sequence[0], input, attributeName));
 }