private string GetTableNamespace(XmlSchemaIdentityConstraint key)
{
string xpath = key.Selector.XPath;
string[] split = xpath.Split('/');
string prefix = string.Empty;
string QualifiedTableName = split[split.Length - 1]; //get the last string after '/' and ':'
if ((QualifiedTableName == null) || (QualifiedTableName.Length == 0))
throw ExceptionBuilder.InvalidSelector(xpath);
if (QualifiedTableName.IndexOf(':') != -1)
prefix = QualifiedTableName.Substring(0, QualifiedTableName.IndexOf(':'));
else
return GetMsdataAttribute(key, Keywords.MSD_TABLENS);
prefix = XmlConvert.DecodeName(prefix);
return GetNamespaceFromPrefix(prefix);
}