public override void WriteQualifiedName (
string localName, string ns)
{
if (localName == null)
throw ArgumentError ("localName");
if (ns == null)
ns = String.Empty;
if (ns == XmlnsNamespace)
throw ArgumentError ("Prefix 'xmlns' is reserved and cannot be overriden.");
if (!XmlChar.IsNCName (localName))
throw ArgumentError ("localName must be a valid NCName.");
ShiftStateContent ("QName", true);
string prefix = ns.Length > 0 ? LookupPrefix (ns) : String.Empty;
if (prefix == null) {
if (state == WriteState.Attribute)
prefix = MockupPrefix (ns, false);
else
throw ArgumentError (String.Format ("Namespace '{0}' is not declared.", ns));
}
if (prefix != String.Empty) {
writer.Write (prefix);
writer.Write (":");
}
writer.Write (localName);
}