public ActionResult XSDtest()
{
string pathXsd = "G:/schema.xsd";
string pathXml = "G:/test.xml";
XmlSchema Schema;
try
{
XmlDocument doc = new XmlDocument();
if (FileHelper.FileExist("pathXml"))
FileHelper.Delete(pathXml);
XmlNode root = doc.CreateElement("xyz");
XmlAttribute rootAttr = doc.CreateAttribute("xmlns");
rootAttr.Value = "abc";
if (root.Attributes != null) root.Attributes.Append(rootAttr);
XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "utf-8", null);
doc.AppendChild(declaration);
doc.AppendChild(root);
doc.Save(pathXml);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
UiTestModel model = new UiTestModel();
return View("Index",model);
}