Get namespace from xml file C#
I've browsed the questions with similar titles but cannot seem to find exactly what I'm looking for,if anyone spotted a similar question kindly point me to the thread.Here is my question:

I have an xsd file which starts of like this:

  ![Beginning of my xsd file][1]
  [1]: http://i.stack.imgur.com/eR3gW.jpg


I need to know how to programatically access the namespace value of the above file.

Additionally my solution needs to be generic so I cannot simply search for xmlns:xs because the exact name of the namespace may have a different name

I've tried the following, but when debugging the value of the elementNamespace variable is blank "":

    XElement elemet = XElement.Load(@"D:\xsd\Response.xsd");
    string elementNamespace = elemet.GetDefaultNamespace().NamespaceName;
    System.Diagnostics.Debug.WriteLine("Namespace " + elementNamespace);


Get namespace from xml file C#
===

I've browsed the questions with similar titles but cannot seem to find exactly what I'm looking for,if anyone spotted a similar question kindly point me to the thread.Here is my question:

I have an xsd file which starts of like this:

  ![Beginning of my xsd file][1]
  [1]: http://i.stack.imgur.com/eR3gW.jpg


I need to know how to programatically access the namespace value of the above file.

Additionally my solution needs to be generic so I cannot simply search for xmlns:xs because the exact name of the namespace may have a different name

I've tried the following, but when debugging the value of the elementNamespace variable is blank "":

    XElement elemet = XElement.Load(@"D:\xsd\Response.xsd");
    string elementNamespace = elemet.GetDefaultNamespace().NamespaceName;
    System.Diagnostics.Debug.WriteLine("Namespace " + elementNamespace);

