NamespaceNames
Contains a list of common namespaces.
using System.Collections.Generic;
namespace AngleSharp.Html
{
internal static class NamespaceNames
{
public static readonly string HtmlUri = "http://www.w3.org/1999/xhtml";
public static readonly string XmlNsUri = "http://www.w3.org/2000/xmlns/";
public static readonly string XLinkUri = "http://www.w3.org/1999/xlink";
public static readonly string XmlUri = "http://www.w3.org/XML/1998/namespace";
public static readonly string SvgUri = "http://www.w3.org/2000/svg";
public static readonly string MathMlUri = "http://www.w3.org/1998/Math/MathML";
public static readonly string HtmlPrefix = "html";
public static readonly string XmlNsPrefix = "xmlns";
public static readonly string XLinkPrefix = "xlink";
public static readonly string XmlPrefix = "xml";
public static readonly string SvgPrefix = "svg";
public static readonly string MathMlPrefix = "mathml";
private static readonly Dictionary<string, string> namespaces = new Dictionary<string, string> {
{
HtmlPrefix,
HtmlUri
},
{
XLinkPrefix,
XLinkUri
},
{
XmlPrefix,
XmlUri
},
{
XmlNsPrefix,
XmlNsUri
},
{
SvgPrefix,
SvgUri
},
{
MathMlPrefix,
MathMlUri
}
};
public static string DeclarationFor(string prefix)
{
if (string.IsNullOrEmpty(prefix))
return XmlNsPrefix;
return XmlNsPrefix + ":" + prefix;
}
public static string LookupNamespaceUri(string prefix)
{
string value = null;
namespaces.TryGetValue(prefix, out value);
return value;
}
}
}