WebMarkupMin.Core.Parsers.XmlParser.ProcessStartTag C# (CSharp) Method

ProcessStartTag() private method

Process a start tag
private ProcessStartTag ( ) : bool
return bool
        private bool ProcessStartTag()
        {
            bool isProcessed = false;
            string content = _innerContext.SourceCode;
            int contentRemainderLength = _innerContext.RemainderLength;

            var match = _startTagRegex.Match(content, _innerContext.Position, contentRemainderLength);
            if (match.Success)
            {
                string startTag = match.Value;

                GroupCollection groups = match.Groups;
                string startTagName = groups["tagName"].Value;
                string attributesString = groups["attributes"].Value;
                bool isEmptyTag = (groups["emptyTagSlash"].Value.Length > 0);

                IList<XmlAttribute> attributes = ParseAttributes(attributesString);
                if (isEmptyTag)
                {
                    if (_handlers.EmptyTag != null)
                    {
                        _handlers.EmptyTag(_context, startTagName, attributes);
                    }
                }
                else
                {
                    _tagStack.Push(new StackedXmlTag(startTagName, _innerContext.NodeCoordinates));

                    if (_handlers.StartTag != null)
                    {
                        _handlers.StartTag(_context, startTagName, attributes);
                    }
                }

                _innerContext.IncreasePosition(startTag.Length);
                isProcessed = true;
            }

            return isProcessed;
        }