【发布时间】:2010-12-07 07:44:33
【问题描述】:
我想根据它的架构定义验证一个数字签名的 xml,而这个架构实际上包含这个标签
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd" id="schema"/>
然后我尝试加载架构:
XmlReaderSettings settings = new XmlReaderSettings();
settings.Schemas.Add(null, "a.xsd");
settings.Schemas.Compile();
我会收到以下错误 'http://www.w3.org/2000/09/xmldsig#:Signature' 元素未声明。
【问题讨论】:
-
您的 XML 是否在 XmlSpy 之类的工具中验证?如果我没记错的话,您应该能够使用 XmlReader.. 验证导入/包含的架构
标签: c# xml validation schema