解决方案 »

  1.   

    如果想让xml中的元素可以按任意顺序出现,需要在schema(xsd)配置all属性,http://www.w3school.com.cn/schema/el_all.asp
    <xs:all>
          <xs:element name="firstname" type="xs:string"/>
          <xs:element name="lastname" type="xs:string"/>
    </xs:all>
      

  2.   


    <xs:all>
    <xs:element ref="ConstructStruct"/>
    <xs:element ref="SummaryTable"/>
    <xs:element ref="MeasureTable"/>
    <xs:element ref="JobList" minOccurs="0" maxOccurs="unbounded"/>
    </xs:all>
    改掉之后,出现这个问题
    org.xml.sax.SAXParseException: cos-all-limited.2: The {max occurs} of an element in an 'all' model group must be 0 or 1. The value '-1' for element 'JobList' is invalid.
      

  3.   

    将<xs:element ref="JobList" minOccurs="0" maxOccurs="unbounded"/>改为<xs:element ref="JobList" minOccurs="0" maxOccurs="1"/>