private void WriteTypeQualifier(XmlWriter writer, ITypeSerializationInfo type)
{
if (type.NamespacePrefix != null)
{
if (writer.LookupPrefix(type.Namespace) != type.NamespacePrefix)
{
writer.WriteAttributeString("xmlns", type.NamespacePrefix, null, type.Namespace);
}
writer.WriteAttributeString(XMLSchemaInstancePrefix, TypeField, XMLSchemaInstanceNamespace,
type.NamespacePrefix + ":" + type.ElementName);
}
else
{
writer.WriteStartAttribute(XMLSchemaInstancePrefix, TypeField, XMLSchemaInstanceNamespace);
writer.WriteQualifiedName(type.ElementName, type.Namespace);
writer.WriteEndAttribute();
}
}