Re: deriving complexTypes from imported types

Gayathri Veerarajan asks:

>> can I derive  a new complexType from an imported type with the same name. 
...
>> here the new complex type is of different namespace. 

Your question is not quite clear, but I believe the answer is yes in any 
case.  Specifically:

If you have a complex type a:t you can as easily derive a b:t as you could 
b:t2 (presuming a: and b: are bound to different namespaces).   The name 
of a type, element declaration etc. consists of the pair of {nsUri, 
localname}.  In these examples, the localnames are t, t2, etc.  If any 
part of the name is different, you are defining a new type, which is fine. 
 

The other thing you can do with care is to redefine the same type in the 
same namespace.  Thus, a:t is a redefinition of a:t.  This is done using 
<xsd:redefine>, and is often used as a means of evolving a schema.  When 
you redefine a:t, the redefined version completely replaces the base for 
all uses in the schema (except of course, that the original is used as the 
base for the derivation.)

I hope this helps.

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








gayathri veerarajan <gaytri_v@yahoo.co.in>
Sent by: xmlschema-dev-request@w3.org
04/16/2004 03:10 AM

 
        To:     xmlschema-dev@w3.org
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        deriving complexTypes from imported types


can I derive  a new complexType from an imported type with the same name. 
 
<complexType name="Camera">
 <complexContent>
  <extension base="camera:Camera">
   <sequence>
       <element name="Serial No" type="string"/>
    </sequence>
  </extension>
 </complexContent>
</complexType>
 
I know that this can be done by defining the complexType only with the 
same target namespace. here the new complex type is of different 
namespace. is this possible? 
with regards,
V.gayathri.
 


Yahoo! India Matrimony: Find your partner online.

Received on Saturday, 17 April 2004 23:00:02 UTC