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;
}