private Unit HandleEmptyElement(XmlTextReader reader, IObserver <SaxEvent> observer, string[] path) { var attributes = new Dictionary <string, string>(); var strUri = reader.NamespaceURI; var strName = reader.Name; if (reader.HasAttributes) { for (var i = 0; i < reader.AttributeCount; i++) { reader.MoveToAttribute(i); attributes.Add(reader.Name, reader.Value); } } var readOnlyAttributes = new ReadOnlyDictionary <string, string>(attributes); var endElementEvent = new EndElementEvent(strUri, strName, true, readOnlyAttributes, new List <SaxEvent>(), path); _contentHolder.Append(endElementEvent); observer.OnNext(endElementEvent); return(Unit.Default); }
private Unit HandleEndElement(XmlTextReader reader, IObserver <SaxEvent> observer, string[] path) { var content = _contentHolder.GetContent(); var startElement = _contentHolder.StartSaxEvent; _contentHolder = _contentHolder.Parent; var strUri = reader.NamespaceURI; var strName = reader.Name; var endElementEvent = new EndElementEvent(strUri, strName, false, startElement.Attributes, content, path); _contentHolder.Append(endElementEvent); observer.OnNext(endElementEvent); return(Unit.Default); }