Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Extensible enumerations in XML Schema

From: <andreas.ebbert-karroum@-----.--->
To: <xmlschema-dev@--.--->
Date: 11/23/2006 4:19:00 PM
Hi,

my problem is the following. I have a complex type that has one =
attribute that is based on an enumeration. The XML schema that I define =
is fixed, but a customer/user of that schema should be able to add items =
to the enumeration in an additional schema. 

Currently the approach is:
1) use an element reference in the complex type
2) have an abstract element of type string
3) define a simple type that contains the enum literals based on string
4) have another element, that is of simple type and has the abstract =
element as substitution group.
5) Users can extend the enumeration, by repeating step 3&4 in an own =
schema, and provide a different enumeration simpleType, which ideally =
includes the enum values of the original/parent simpleType.

Details to the steps are further down.
My questions are:
=> Is there a better way to do this? For example that a client/user =
don't have to repeat all existing enums, but can somehow merge them in =
with a union simple type?
=> How could a complex type definition look like that is an array of =
the enum, and is also capable of using the customer extension?

1) 
	<complexType name="BusinessInteractionValue">
		<complexContent>
			<extension base="ns3:EntityValue">
				<sequence>
					<element ref="ns0:baseState" minOccurs="0"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>

2)
	<element name="baseState" type="string" abstract="true"/>

3)
	<element name="state" type="ns0:RequestState" =
substitutionGroup="ns0:baseState"/>

4)
	<simpleType name="RequestState">
		<restriction base="string">
			<enumeration value="ABORTED"/>
			...
			<enumeration value="PARTIALLY_COMPLETED"/>
		</restriction>
	</simpleType>

5) -- in a separate schema --
	<simpleType name="ExtendedRequestState">
		<restriction base="string">
			<enumeration value="ABORTED"/>
			...
			<enumeration value="PARTIALLY_COMPLETED"/>
			<enumeration value="open.running.new1"/>
			<enumeration value="open.running.new2"/>
			<enumeration value="open.running.new3"/>
		</restriction>
	</simpleType>
	<element name="extendedRequestState" =
type="aek:ExtendedRequestState" substitutionGroup="om:baseState"/>

 _         __                _  _
//\ndreas.[|-bbert-[]/arroum(a)[|\|okia.com
           `-        `
   Andreas Ebbert-Karroum
      =A0=A0 Senior Software Design Engineer
                Nokia Networks Services / Middleware 
=A0=A0 phone: +49-211-94123928, fax: +49-211-9412-3838
=A0=A0 Heltorfer Stra=DFe 1, 40472 D=FCsseldorf, Germany 

----------------------------------------------------------------------
This message is confidential. If you have received this message in =
error,
please delete it from your system. You should not copy it for any =
purpose,
or disclose its contents to any other person. Internet communications =
are
not secure and therefore Nokia GmbH does not accept legal responsibility
for the contents of this message as it has been transmitted over a =
public
network. Thank you.
Nokia GmbH, Nokia Networks is a German Company. Further information
about the Company is available from its principal offices at
Heltorferstrasse 1, D-40472, D=FCsseldorf, Germany and from the
website at http://www.nokia.com/
----------------------------------------------------------------------


From george@o... Tue Nov 28 08:35:24 2006
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1Go


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent