473,387 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Extensible enumerations in XML Schema

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"/>

Nov 23 '06 #1
0 1241

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Karen Sundquist | last post by:
I have a client who wants to build a database with a user extensible schema. The client wants to model an entity with about 100 numeric attributes. As time goes on, more numeric attributes will...
1
by: Joyce | last post by:
In my schema I have 2 enumerations, let's say, country description and country code, and I want to use them so I can map each country description to its precise country code (and no other). So far...
0
by: Florian von Savigny | last post by:
Hi there, I am having a hard time in grasping how the TBX (TermBase eXchange format), authored by LISA (http://www.lisa.org/tbx/) exactly works. What I seem to have understood is the...
2
by: Glenn | last post by:
I've been trying to generate enumerations with specific integer values using an XSD and xsd.exe. e.g public enum AccessSecurity { Normal = 1, Restricted = 100001 }
1
by: Oleg Ogurok | last post by:
Hi all, I've added a new DataSet (xsd file) to my project in VS.NET 2003. There I create a simple type as an enumeration of values. <xs:simpleType name="MyCustomType"> <xs:restriction...
0
by: c j anderson, mcp | last post by:
Core Question: Is there a better way to dynamically pull the allowed values of an attribute out of a dataset's schema. I have an XML file that contains a string element with two attributes,...
77
by: Ben Finney | last post by:
Howdy all, PEP 354: Enumerations in Python has been accepted as a draft PEP. The current version can be viewed online: <URL:http://www.python.org/peps/pep-0354.html> Here is the...
1
by: Udo | last post by:
Hello, XSLT-defined elements can have additional attributes - is this possible with XSD, too? Thanks and greetings Udo
2
by: Dan Bron | last post by:
Hello, Does xsd.exe support generating .NET enumerations from XSD enumerations? That is, if I have ... <xs:simpleType name="US_STATE">
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.