Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Retreiving the original content of an extended type
Retreiving the original content of an extended type [message #37043] Tue, 03 February 2004 08:22 Go to next message
Eclipse UserFriend
Originally posted by: niemaz.xrce.xerox.com

Hi,
Is it possible to get the original content model of an extended type?
I thought so and I tried using getTypes methods but it does not seem to
work.
Is there another way to do it?
Next is a simple example I'm working on.

Thanx,

--mike

<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:complexType>
<xs:complexType name="UKAddress">
<xs:complexContent>
<xs:extension base="Address">
<xs:sequence>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
<xs:attribute name="exportCode" type="xs:positiveInteger" fixed="1"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Re: Retreiving the original content of an extended type [message #37077 is a reply to message #37043] Tue, 03 February 2004 22:16 Go to previous message
David Steinberg is currently offline David SteinbergFriend
Messages: 489
Registered: July 2009
Senior Member
mike wrote:
> Is it possible to get the original content model of an extended type?
> I thought so and I tried using getTypes methods but it does not seem to
> work.

Hi Mike,

XSDComplexTypeDefinition.getBaseTypeDefinition() returns the type that was
extended. Cast that result to XSDComplexTypeDefinition, and call
getContentType() on it to get its content model.

Cheers,
Dave
Re: Retreiving the original content of an extended type [message #583391 is a reply to message #37043] Tue, 03 February 2004 22:16 Go to previous message
David Steinberg is currently offline David SteinbergFriend
Messages: 489
Registered: July 2009
Senior Member
mike wrote:
> Is it possible to get the original content model of an extended type?
> I thought so and I tried using getTypes methods but it does not seem to
> work.

Hi Mike,

XSDComplexTypeDefinition.getBaseTypeDefinition() returns the type that was
extended. Cast that result to XSDComplexTypeDefinition, and call
getContentType() on it to get its content model.

Cheers,
Dave
Previous Topic:Retreiving the original content of an extended type
Next Topic:Unresolved element when validate using DOM format
Goto Forum:
  


Current Time: Mon Dec 22 12:58:26 GMT 2014

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

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