XSD elements in C#
<p>I have an XSD file and I need to get a list of the names of all the elements in it.</p>

<p>I tried the following:</p>

<pre><code>openFileDialog1.ShowDialog();
tbSchema.Text = openFileDialog1.FileName;

cbElement.Items.Clear();

XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add("", tbSchema.Text);
schemaSet.Compile();
XmlSchema customerSchema = null;
foreach (XmlSchema schema in schemaSet.Schemas())
{
    customerSchema = schema;
}
foreach (XmlSchemaElement element in customerSchema.Elements.Values)
{
    cbElement.Items.Add(element.Name);
}
</code></pre>

<p>but it still does not work.</p>
