This is the child node that I want to add but if I use createElement
method it includes xmlns
attribute automatically but it doesn't required so give me some solution to add below node in xml .
<linkbase:schemaRef
xlink:type="simple"
xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"
xlink:href="http://www.mca.gov.in/XBRL/2011/08/27/Taxonomy/CnI/ci/in-gaap-ci-2011-03-31.xsd">
</linkbase:schemaRef>
My program:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// Create the XmlDocument.
XmlDocument XDoc = new XmlDocument();
XmlDeclaration declaration = XDoc.CreateXmlDeclaration("1.0", "UTF-8", "");
XmlElement XElemRoot = XDoc.CreateElement("xbrli", "xbrl", "http://www.xbrl.org/2003/instance" );
XElemRoot.SetAttribute("xmlns:in-ca-types", "http://www.xbrl.org/in/2011-03-31/in-ca-types");
XElemRoot.SetAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
XElemRoot.SetAttribute("xmlns:net", "http://www.xbrl.org/2009/role/net" );
XElemRoot.SetAttribute("xmlns:num", "http://www.xbrl.org/dtr/type/numeric" );
XElemRoot.SetAttribute("xmlns:in-roles", "http://www.xbrl.org/in/2011-03-31/in-gaap-roles" );
XElemRoot.SetAttribute("xmlns:link", "http://www.xbrl.org/2003/linkbase" );
XElemRoot.SetAttribute("xmlns:negated", "http://www.xbrl.org/2009/role/negated");
XElemRoot.SetAttribute("xmlns:iso4217", "http://www.xbrl.org/2003/iso4217" );
XElemRoot.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
XElemRoot.SetAttribute("xmlns:xbrldt","http://xbrl.org/2005/xbrldt");
XElemRoot.SetAttribute("xmlns:in-gaap","http://www.xbrl.org/in/2011-03-31/in-gaap");
XElemRoot.SetAttribute("xmlns:nonnum","http://www.xbrl.org/dtr/type/non-numeric" );
XElemRoot.SetAttribute("xmlns:in-gaap-ci","http://www.xbrl.org/in/2011-03-31/in-gaap-ci" );
XElemRoot.SetAttribute("xmlns:in-ca","http://www.xbrl.org/in/2011-03-31/in-ca" );
XElemRoot.SetAttribute("xmlns:xhtml","http://www.w3.org/1999/xhtml" );
XElemRoot.SetAttribute("xmlns:in-ca-roles", "http://www.xbrl.org/in/2011-03-31/in-ca-roles");
XDoc.AppendChild(declaration);
XDoc.AppendChild(comment);
XDoc.AppendChild(XElemRoot);
XDoc.Save(@"C:\XBRLDoc.xml");
}
}