我从Xero获取xml架构:https://github.com/XeroAPI/XeroAPI-Schemas
.count
架构是项目中的嵌入式资源。当我尝试做schemaSet.Add(schema)时;我总是得到" Type' entityValidationStatus'未声明,或不是简单类型"。以下是我的架构:
var assembly = Assembly.GetExecutingAssembly();
var stream = assembly.GetManifestResourceStream("XeroConnector.XmlSchemas." + selectedEndPoint.Schema + ".xsd");
using (var reader = XmlReader.Create(stream))
{
schema = XmlSchema.Read(reader, null);
}
schemaSet.Add(schema);