How to format schema output
I'm creating a schema in code and I want to save it to a file. But in the file the schema is not formatted but is display as one big line.
var nsmgr = new XmlNamespaceManager(new NameTable());
nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
nsmgr.AddNamespace("name", "someNamespace");
v开发者_开发知识库ar xtw = new XmlTextWriter("somepath", Encoding.UTF-8);
schema.Write(xtw, nsmgr);
Is there a component that formats the schema?
You can set some formatting options on XmlWriter, see e.g. this article: https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-22_11-5075652.html
There is the list of possible options: http://msdn.microsoft.com/en-us/library/kbef2xz3.aspx
精彩评论