我正在尝试使用 ReadXmlSchema
通过 C# 读取 xsd 文件。
但是我在尝试读取 xsd 文件时遇到了问题。我收到了错误消息
The 'use' attribute is not supported in this context.
实际上 xsd 包含属性 use="required"
。
<xs:attribute name="sch" type="xs:string" use="required"/>
DataSet ds = new DataSet();
ds.ReadXmlSchema(@"C:\Schema\Schema.xsd");
有什么问题吗?
最佳答案
只有在定义全局属性时才会收到此错误消息。只有当属性是内容模型的一部分时,您才能使用。
关于c# - 在此上下文中不支持 'use' 属性。 C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11668742/