문제

I was wondering if mixing "referecened" and "inline" types is allowed in XSD, e.g.:

<schema>
  <element name="library" type="departments">
    <complexType>
      <sequence>
        <element name="department_name" type="string"/>
      </sequence>
    </complexType>
  </element>
  <complexType name="departements">
    <sequence>
      <element name="department_name" type="string"/>
    </sequence>
  </complexType>
</schema>

If yes, how do I we distinguish between departement_names? Do one of them take precedence over the other? TIA!

도움이 되었습니까?

해결책

When you run this XSD file over XML with validation, you will get an error, as your declaration conflicts with 3.3.3 Constraints on XML Representations of Element Declarations, point 3.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top