private void Cleanup() { this.line = 1; this.column = 0; this.handler = null; this.reader = null; this.elementNames.Clear(); this.xmlSpaces.Clear(); this.attributes.Clear(); this.buffer.Length = 0; this.xmlSpace = null; this.isWhitespace = false; }
public void Parse(TextReader input, SmallXmlParser.IContentHandler handler) { this.reader = input; this.handler = handler; handler.OnStartParsing(this); while (this.Peek() >= 0) { this.ReadContent(); } this.HandleBufferedContent(); if (this.elementNames.Count > 0) { throw this.Error(string.Format("Insufficient close tag: {0}", this.elementNames.Peek())); } handler.OnEndParsing(this); this.Cleanup(); }