2
我有一个我已经加载的XDocument文件。 (确认工作)。我需要验证这个文件。为此,我将一个XSD文件作为嵌入资源附加到项目中。我加载 这些代码行的xsd:根据特定模式验证XDocument
Assembly assembly = Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream("Project.Models.Ci.def.xsd");
如何我现在可以证实针对该XSD的XML?我只需要知道文件是否有效,所以没有什么奇特的。
doc1.Validate(模式,(发件人,E)=> { Console.WriteLine(e.Message); errors = true; },true); – Patrick