internal static string Namespace(XmlSchemaObject o) { while (o != null && !(o is XmlSchema)) { o = o.Parent; } return o == null ? "" : ((XmlSchema)o).TargetNamespace; } }