请查看以下 XML 命名空间和 schemaLocation。
<agr:ABWInvoice
xsi:schemaLocation = "
http://services.agresso.com/schema/ABWInvoice/2011/11/14
http://services.agresso.com/schema/ABWInvoice/2011/11/14/ABWInvoice.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:agrlib = "http://services.agresso.com/schema/ABWSchemaLib/2011/11/14"
xmlns:agr = "http://services.agresso.com/schema/ABWInvoice/2011/11/14"
>
</agr:ABWInvoice>
我以以下方式添加了命名空间,这似乎工作正常:
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance");
ns.Add("agrlib", "http://services.agresso.com/schema/ABWSchemaLib/2011/11/14");
ns.Add("agr", "http://services.agresso.com/schema/ABWInvoice/2011/11/14");
但是,如何添加以下架构位置?有任何想法吗?
xsi:schemaLocation="http://services.agresso.com/schema/ABWInvoice/2011/11/14 http://services.agresso.com/schema/ABWInvoice/2011/11/14/ABWInvoice.xsd"