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

ParseAttributes() private method

Parses a attributes
private ParseAttributes ( string attributesString ) : IList
attributesString string String representation of the attribute list
return IList
        private IList<XmlAttribute> ParseAttributes(string attributesString)
        {
            var attributes = new List<XmlAttribute>();
            if (string.IsNullOrWhiteSpace(attributesString))
            {
                return attributes;
            }

            MatchCollection attributeMatches = _attributeRegex.Matches(attributesString);

            foreach (Match attributeMatch in attributeMatches)
            {
                GroupCollection groups = attributeMatch.Groups;

                string attributeName = groups["attributeName"].Value;
                string attributeValue = groups["attributeValue"].Value;
                if (!string.IsNullOrWhiteSpace(attributeValue))
                {
                    attributeValue = XmlAttribute.XmlAttributeDecode(attributeValue);
                }

                attributes.Add(new XmlAttribute(attributeName, attributeValue));
            }

            return attributes;
        }