XmlSchemaValidationException:''http://uri.etsi.org/01903/v1.3.2#:已声明任何公共元素。”

时间:2018-11-19 11:04:11

标签: xmlschemaset

当我要验证xml文件时,可能导致xades141.xsd从架构中获取错误。

  private void btnControl_Click(object sender, EventArgs e)
    {

        string path = @"C:\Projeler\Btpro\Defterdar\Src\Defterdar\Btpro.Defterdar.Desktop\EdefterPaket\xsd\";

        XmlSchemaSet schema = new XmlSchemaSet();
        schema.Add("http://www.edefter.gov.tr", path + "edefter.xsd");
        schema.Add("http://www.edefter.gov.tr/ek", path + "edefter_ek.xsd");
        schema.Add("http://uri.etsi.org/01903/v1.3.2#", path + "XAdES.xsd");
        schema.Add("http://uri.etsi.org/01903/v1.4.1#", path + "XAdESv141.xsd");
        schema.Add("http://www.xbrl.org/2003/instance", path + "xbrl-instance-2003-12-31.xsd");
        schema.Add("http://www.xbrl.org/2003/linkbase", path + "xbrl-linkbase-2003-12-31.xsd");
        schema.Add("http://www.xbrl.org/2003/XLink", path + "xl-2003-12-31.xsd");
        schema.Add("http://www.w3.org/1999/xlink", path + "xlink-2003-12-31.xsd");
        schema.Add("http://www.w3.org/2000/09/xmldsig#", path + "xmldsig-core-schema.xsd");
        schema.Add("http://www.xbrl.org/int/gl/plt/2006-10-25", path + @"2006-10-25\plt\case-c-b\gl-plt-2006-10-25.xsd");
        schema.Add("http://www.xbrl.org/int/gl/bus/2006-10-25", path + @"2006-10-25\plt\case-c-b\gl-bus-content-2006-10-25.xsd");
        schema.Add("http://www.xbrl.org/int/gl/cor/2006-10-25", path + @"2006-10-25\plt\case-c-b\gl-cor-content-2006-10-25.xsd");
        schema.Add("http://www.xbrl.org/int/gl/muc/2006-10-25", path + @"2006-10-25\plt\case-c-b\gl-muc-content-2006-10-25.xsd");

        XDocument xdoc = XDocument.Load(@"C:\Users\burak\Desktop\1870655852-201805-Y-000000.xml");
        xdoc.Validate(schema, validationEventHandler);
    }

错误说明:XmlSchemaValidationException:``http://uri.etsi.org/01903/v1.3.2#:Any'公共元素已声明。'

0 个答案:

没有答案