Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-239

Complex type with complexContent which extends a base type with simpleContent causes scomp failure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Version 2.1
    • TBD
    • Compiler
    • None
    • All

    Description

      If you have a schema with the setup as follows:

      <xsd:complexType>
      <xsd:complexContent>
      <xsd:extension base="baseType"> ...

      Then the baseType referenced must (by rule 1 http://www.w3.org/TR/xmlschema-1/#src-ct) be a complex type. However the spec does not specify that the baseType must itself have complexContent. It appears that the spec allows simpleContent. However XmlBeans as it stands will fail specifying that a complex type with complex content must be provided. Example error message is below:

      bmecat_2005.xsd:3681:5: error: src-ct.1: The specified base type 'typeMLSTRING00050@http://www.bmecat.org/bmecat/2005fd' must be a complex type with complex content.

      If we remove the check at StscComplexTypeResolver line 529 that checks for simpleContent (without removing the check for simpleType) the checkintest appears to work and we get files generated which compile correctly. I will attach a patch which does that and updates the error message.

      Attachments

        1. xmlbeans239.patch2
          15 kB
          Lawrence Aston Jones
        2. test_bmecat.xsd
          1 kB
          Lawrence Aston Jones

        Activity

          People

            ljones Lawrence Aston Jones
            ljones Lawrence Aston Jones
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: