Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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:element name="name" type="xs:string"/>
<xs:element name="street" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:attribute name="Person" type="xs:string"/>

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

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

Many thanks for your help,

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

Current Time: Thu May 24 06:40:00 GMT 2018

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

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

Back to the top