[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Enumerated complex types

From: Guillaume Lebleu <gl@brixlogic.com>
Date: Wed, 19 Dec 2007 16:31:38 -0800
Message-ID: <4769B7EA.70509@brixlogic.com>
To: xmlschema-dev@w3.org
Enumerated complex types

Hello,

I was wondering if the use case of enumerated complex types had ever 
come up in this list. I did a quick search and couldn't find anything.

Here is what I mean:

Let's say I want to define a list of error codes, each having a possible 
value, an associated severity level and description, which I have 
specified in the form of a table, and I want to return in an XML message 
this information in the form of a <Status> aggregate containing a 
<StatusCode> element, <Severity> element and <Desc> element. This is a 
realistic use case you can find in industry standards such as IFX and ACORD.

One solution would be to use co-constraint rules: if StatusCode is '100' 
then Severity must be 'Error' and Desc must be 'General Error', but that 
sounds quite complicated and it wouldn't help the manual edition of a 
schema-compliant XML document.

The alternative solution I'm thinking about would be something similar 
to the xs:restriction and xs:enumeration used in simpleTypes, but with a 
value that would essentially be an XML document fragment.

I see several advantages to this representation:

    * It could be leveraged to accelerate the manual edition of XML
      instances of an XML Schema through code completion: I select one
      of the enumerations in a drop-down list, just like today XML
      editors allow me to select an enumerated value from a drop-down list.
    * It is easier than co-constraint representation for business people
      to understand and edit.
    * It might be easier for type checkers to deal with (intuition).

Let me know what you think and sorry if this has already been discussed.

Guillaume
Received on Thursday, 20 December 2007 00:31:55 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.