Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344860 - xs:extension used when defining types cause elements to be out of order
Summary: xs:extension used when defining types cause elements to be out of order
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ling Hao CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-05 12:23 EDT by Shenxue Zhou CLA
Modified: 2021-11-19 09:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shenxue Zhou CLA 2011-05-05 12:23:16 EDT
Here is the basic type:
  <xs:complexType name="ui-info-base-type">
    <xs:sequence>
      <xs:element ref="adf:description" minOccurs="0"/>
      <xs:element ref="adf:display-name" minOccurs="0"/>
      <xs:element ref="adf:icon" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

And here is the type which extends the basic type:
  <xs:complexType name="activityType">
    <xs:complexContent>
      <xs:extension base="adf:ui-info-base-type">
        <xs:attribute name="id" type="xs:ID" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

And here is the type which substitute "activityType":
  <xs:element name="url-view" substitutionGroup="adf:activity">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="adf:activityType">
          <xs:sequence>
            <xs:element name="url" type="adf:expression"/>
            <xs:element name="url-parameter" type="adf:converted-parameter-type"
                        minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

When Sapphire editor is used to create an "url-view" element, it'd generate the following xml:

        <url-view id="google">
            <url>http://www.google.com</url>
            <display-name>google</display-name>
            <description>google</description>
            <icon>
                <small-icon>small</small-icon>
                <large-icon>large</large-icon>
            </icon>
        </url-view>

Notice <display-name> element is after <url> element. <url> element needs to be after <display-name>, <description> and <icon> elements in the xml.
Comment 1 Konstantin Komissarchik CLA 2011-05-05 13:43:45 EDT
Ling,

Could you take a look?
Comment 2 Ling Hao CLA 2011-05-06 15:06:55 EDT
xs:extensions is working fine. The problem was caused by the fix to abstract and substitution attribute in bug 337232. Added unit test for more complete coverage.
Comment 3 Shenxue Zhou CLA 2011-05-06 16:03:39 EDT
Verifed. Thanks Ling!