internal Processor.OutputResult BeginEvent(int state, XPathNodeType nodeType, string prefix, string name, string nspace, bool empty, Object htmlProps, bool search) {
if (! CanOutput(state)) {
return Processor.OutputResult.Overflow;
}
Debug.Assert(this.recordState == NoRecord || (state & StateMachine.BeginRecord) == 0);
AdjustDepth(state);
ResetRecord(state);
PopElementScope();
prefix = (prefix != null) ? this.nameTable.Add(prefix) : this.atoms.Empty;
name = (name != null) ? this.nameTable.Add(name) : this.atoms.Empty;
nspace = (nspace != null) ? this.nameTable.Add(nspace) : this.atoms.Empty;
switch (nodeType) {
case XPathNodeType.Element:
this.mainNode.htmlProps = htmlProps as HtmlElementProps;
this.mainNode.search = search;
BeginElement(prefix, name, nspace, empty);
break;
case XPathNodeType.Attribute:
BeginAttribute(prefix, name, nspace, htmlProps, search);
break;
case XPathNodeType.Namespace:
BeginNamespace(name, nspace);
break;
case XPathNodeType.Text:
break;
case XPathNodeType.ProcessingInstruction:
if (BeginProcessingInstruction(prefix, name, nspace) == false) {
return Processor.OutputResult.Error;
}
break;
case XPathNodeType.Comment:
BeginComment();
break;
case XPathNodeType.Root:
break;
case XPathNodeType.Whitespace:
case XPathNodeType.SignificantWhitespace:
case XPathNodeType.All:
break;
}
return CheckRecordBegin(state);
}