XmlEntityService
Represents the list of all Xml entities.
using AngleSharp.Services;
using System.Collections.Generic;
namespace AngleSharp.Xml
{
public sealed class XmlEntityService : IEntityProvider
{
private readonly Dictionary<string, string> _entities = new Dictionary<string, string> {
{
"amp",
"&"
},
{
"lt",
"<"
},
{
"gt",
">"
},
{
"apos",
"'"
},
{
"quot",
"\""
}
};
public static readonly IEntityProvider Resolver = new XmlEntityService();
private XmlEntityService()
{
}
public string GetSymbol(string name)
{
string value = string.Empty;
if (!string.IsNullOrEmpty(name))
_entities.TryGetValue(name, out value);
return value;
}
}
}