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
}