在 complexType 定义中,sequence 要放在 attribute 的前面:
<xs:complexType name="exceptionType"> <xs:sequence> <xs:element name="defaultMessage" type="xs:string" /> </xs:sequence> <xs:attribute name="class" type="xs:string" /> <xs:attribute name="errorId" type="xs:string" /> </xs:complexType>