1

我有以下 XSD,它是从使用 XAML 2009 序列化的配置文件中生成的。但是,当我将架构放入Online Validator中时,我得到 src-resolve: Cannot resolve the name 'scg:List' to a(n) 'element声明'组件。错误。

    <?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:csu="clr-namespace:ConfigurationUtilityFunctions.Section.User;assembly=ConfigurationUtilityFunctions" xmlns:csw="clr-namespace:ConfigurationUtilityFunctions.Section.WebConfig;assembly=ConfigurationUtilityFunctions" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="clr-namespace:ConfigurationUtilityFunctions;assembly=ConfigurationUtilityFunctions" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="clr-namespace:System.Collections.Generic;assembly=mscorlib" />
  <xs:element name="ConfigProfile">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="ConfigProfile.ConfigSections">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="scg:List" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ProfileId" type="xs:string" use="required" />
      <xs:attribute name="InstanceName" type="xs:string" use="required" />
      <xs:attribute name="ProfileDesc" type="xs:string" use="required" />
      <xs:attribute name="ProfileName" type="xs:string" use="required" />
      <xs:attribute name="ProfileType" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="IISSection">
    <xs:complexType>
      <xs:attribute name="AnonymousUser" type="xs:string" use="required" />
      <xs:attribute name="ApplicationPoolName" type="xs:string" use="required" />
      <xs:attribute name="Port" type="xs:unsignedByte" use="required" />
      <xs:attribute name="VirtualDirectoryAlias" type="xs:string" use="required" />
      <xs:attribute name="WebsiteName" type="xs:string" use="required" />
      <xs:attribute name="WebsiteRoot" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
</xs:schema>
4

1 回答 1

1

您的 XML 命名空间scg实际上是指:

clr-namespace:System.Collections.Generic;assembly=mscorlib

我怀疑您的架构验证器是否可以访问mscorlib程序集。

于 2012-07-20T15:28:23.743 回答