我从客户那里得到了以下 XSD 位。它是跨越数十个文件的遗留模式的一部分。
<xs:element name="stateProvinceName">
  <xs:complexType mixed="true">
    <xs:attributeGroup ref="xml:attlist.global-attributes"/>
  </xs:complexType>
</xs:element>
我试图弄清楚他们真正想要什么。没有子元素,那么这个 'xs:mixed' 是什么意思呢?它应该是 simpleContent,还是没有内容?
我告诉他们应该使用更标准的结构,例如
<xs:element name="stateProvinceName">
  <xs:complexType>
    <xs:simpleContent>
       <xs:extension base="xs:string">
         <xs:attributeGroup ref="xml:attlist.global-attributes"/>
       </xs:extension>
     </xs:simpleContent>
  </xs:complexType>
</xs:element>
但他们不确定这是否意味着同样的事情。两种模式都接受
<stateProvinceName ID="345643">California</stateProvinceName>
和
<stateProvinceName ID="345643"/>