我想根据其架构定义验证数字签名的 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 ' 元素未声明。
最佳答案
您还需要使用另一个加载导入的架构
settings.Schemas.Add([导入的命名空间]
, [pathtoimportedXSD]
);
关于c# - 无法在 C# 中验证多个 xsd 架构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1577150/