protected void WriteAttribute(string localName, string ns, string value)
{
if (value == null) return;
if (localName == "xmlns" || localName.StartsWith("xmlns:", StringComparison.Ordinal))
{
;
}
else
{
int colon = localName.IndexOf(':');
if (colon < 0)
{
if (ns == XmlReservedNs.NsXml)
{
string prefix = _w.LookupPrefix(ns);
if (prefix == null || prefix.Length == 0)
prefix = "xml";
_w.WriteAttributeString(prefix, localName, ns, value);
}
else
{
_w.WriteAttributeString(localName, ns, value);
}
}
else
{
string prefix = localName.Substring(0, colon);
_w.WriteAttributeString(prefix, localName.Substring(colon + 1), ns, value);
}
}
}