System.Xml.Schema.DfaContentValidator.ValidateElement C# (CSharp) Method

ValidateElement() public method

Algorithm 3.1 Simulating a DFA
public ValidateElement ( XmlQualifiedName name, ValidationState context, int &errorCode ) : object
name XmlQualifiedName
context ValidationState
errorCode int
return object
        public override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode) {
            int symbol = symbols[name];
            int state = transitionTable[context.CurrentState.State][symbol];
            errorCode = 0;
            if (state != -1) {
                context.CurrentState.State = state;
                context.HasMatched = transitionTable[context.CurrentState.State][symbols.Count] > 0;
                return symbols.GetParticle(symbol); // OK
            }
            if (IsOpen && context.HasMatched) {
                // XDR allows any well-formed contents after matched.
                return null;
            }
            context.NeedValidateChildren = false;
            errorCode = -1;
            return null; // will never be here
        }