Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Analysing Complex Types derived by extension
Analysing Complex Types derived by extension [message #592518] Fri, 19 November 2004 14:55
Ray is currently offline RayFriend
Messages: 9
Registered: July 2009
Junior Member
Hi there,

I'm having a problem analysing a complex type hierarchy using the API -
below are the complex type definitions I'm using. As you can see,
USAddress derives from Address, and NYAddress derives from USAddress.

The problem I'm encountering is when analysing a derived complex type. In
the attribute uses, I get all the attributes from the subtype and its base
type(s). However, as far as element declarations go, I only get the ones
from this particular type - which in the case of the NY address is none.
To get these I have to look at the base type definitions.

This seems fair enough in some ways, but the fact that the attributes do
appear in the attribute uses list seems to contradict this approach. Does
anyone have any ideas why this approach has been taken, or is it a flaw?

<xs:complexType name="Address">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="street" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
</xs:sequence>
<xs:attribute name="Person" type="xs:string"/>
</xs:complexType>

<xs:complexType name="USAddress">
<xs:complexContent>
<xs:extension base="Address">
<xs:sequence>
<xs:element name="state" type="xs:string"/>
<xs:element name="zip" type="xs:string"/>
</xs:sequence>
<xs:attribute name="Surname" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="NYAddress">
<xs:complexContent>
<xs:extension base="USAddress">
<xs:attribute name="RentControlled" type="xs:boolean"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>


Many thanks for your help,

Ray
Previous Topic:Where it is refernced ?
Next Topic:enumeration-facet of union types
Goto Forum:
  


Current Time: Tue Apr 16 22:10:34 GMT 2024

Powered by FUDForum. Page generated in 2.76968 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top