i am creating xml using linq.xml through xelement.
my hirerachy is some thing like this
I want this schema
2
str
here is my code for schema generation
XNamespace ns = XNamespace.Get("urn:APISchema.xsd");
root = new XElement(ns + "Foo");
root.Add(new XElement("version", "2"));
root.Add(new XElement("foochild", "str"));
but the resultant schema is
<Foo xlmns="urn:APISchema.xsd">
<version xlmns="">2</version>
<foochild xlmns="">str</foochild>
</Foo>
any idea why such problem why it is appending xlmn to root childs…?
Edit: upon further SO searching, this question seems to be addressing the same issue.