OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Is there a way to reuse and extend an enumeration in XML s

[ Lists Home | Date Index | Thread Index ]
  • To: "Kenneth Stephen" <marvin.the.paranoid@gmail.com>, "XML Developers List" <xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] Is there a way to reuse and extend an enumeration in XML schema
  • From: "Chiusano Joseph" <chiusano_joseph@bah.com>
  • Date: Sat, 5 Mar 2005 23:01:02 -0500
  • Thread-index: AcUh23UVW+8uitqERrK3mrueKSM1kQAJMKyA
  • Thread-topic: [xml-dev] Is there a way to reuse and extend an enumeration in XML schema

Try using the W3C Schema "union" datatype for this (if that's not the
correct approach, Jeni Tennison, Henry Thompson or others will be along
shortly to correct me, I'm sure). 

So you would define an additional simple type as follows (note that
"your_current_simple_type_name" refers to the simpleType you referred to
when you said "I have a simpleType defined as..."):

<simpleType name="new_simple_type_name">
  <union memberTypes="your_current_simple_type_name">
    <simpleType>
      <restriction base="NMTOKEN">
        <enumeration value="D"/>
      </restriction>
    </simpleType>
  </union>
</simpleType>

You would then need to change element declarations accordingly - i.e.
elements that are currently declared as being of your original simple
type would have to be of your new simple type.

Kind Regards,
Joseph Chiusano
Booz Allen Hamilton
Strategy and Technology Consultants to the World
 

> -----Original Message-----
> From: Kenneth Stephen [mailto:marvin.the.paranoid@gmail.com] 
> Sent: Saturday, March 05, 2005 6:29 PM
> To: XML Developers List
> Subject: [xml-dev] Is there a way to reuse and extend an 
> enumeration in XML schema
> 
> Hi,
> 
>     I have a simpleType defined as having an enumerated type 
> having (for example) values 'A','B', and 'C'. I want to be 
> able to reuse this type elsewhere and also add an additional 
> value of 'D' without altering the original definition. Is 
> there a way to do that?
> 
> Thanks,
> Kenneth
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org 
> <http://www.xml.org>, an initiative of OASIS 
> <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
> 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS