xml schema 验证问题
try
{
String schema = "";
String nameSpace = "";
XmlSchemaCollection xsc = new XmlSchemaCollection();
schema = "Getty_Vocabulary_ULAN.xsd";
nameSpace = "http://localhost";
xsc.Add(nameSpace, schema); //XSD schema
}
catch (Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);
}
请教各位这段代码有什么问题?运行到 xsc.Add(nameSpace, schema); 行时总是出现下面的错误信息, 但是通过xml spy 验证Getty_Vocabulary_ULAN.xsd文件一点问题也没有阿, 气死我也。
ex.Message "Namespace attribute must not match the real value of the enclosing <schema>'s targetNamespace. An error occurred at http://localhost/Getty_Vocabulary_ULAN.xsd(5, 3)." string