示例#1
0
        private void OnAttribute(object sender, HtmlParserAttributeEventArgs e)
        {
            if (_currentElementRecord != null)
            {
                var currentElement = _currentElementRecord.Element;
                var a = AttributeNode.Create(currentElement, e.AttributeToken);

                List <AttributeNode> attributeCollection;

                if (currentElement.StartTag.IsComplete)
                {
                    attributeCollection = _currentElementRecord.EndTagAttributes;
                }
                else
                {
                    attributeCollection = _currentElementRecord.StartTagAttributes;
                }

                attributeCollection.Add(a);
            }
        }