internal string GetInstanceName(XmlElement node)
{
string instanceName;
if (FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS) ||
FEqualIdentity(node, Keywords.XDR_ATTRIBUTETYPE, Keywords.XDRNS))
{
instanceName = node.GetAttribute(Keywords.NAME);
if (instanceName == null || instanceName.Length == 0)
{
throw ExceptionBuilder.MissingAttribute("Element", Keywords.NAME);
}
}
else
{
instanceName = node.GetAttribute(Keywords.TYPE);
if (instanceName == null || instanceName.Length == 0)
throw ExceptionBuilder.MissingAttribute("Element", Keywords.TYPE);
}
return instanceName;
}