Example #1
0
 public void Parse(TextReader input, 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();
 }
Example #2
0
        public void Parse(TextReader input, IContentHandler handler)
        {
            this.reader = input;
            this.handler = handler;

            handler.OnStartParsing(this);

            while (Peek() >= 0)
            {
                ReadContent();
            }

            HandleBufferedContent();
            if (elementNames.Count > 0)
                throw Error(String.Format("Insufficient close tag: {0}", elementNames.Peek()));

            handler.OnEndParsing(this);

            Cleanup();
        }