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

SV: Schema 1.1: xs:anyEnumeration considered?

From: Bryan Rasmussen <BRS@itst.dk>
Date: Mon, 19 Mar 2007 11:03:18 +0100
Message-ID: <A2DF252098C9AD4B9781453BE4C5422B02FBE510@excw2k301.koncern.local>
To: "Pete Cordell" <petexmldev@tech-know-ware.com>, <xmlschema-dev@w3.org>
SV: Schema 1.1: xs:anyEnumeration considered?

Whats the use of that? Wouldn't you just, in real life usage, want to say
well this can hold any 3,4 length enumeration therefore I will use the
<xs:pattern value="[a-zA-Z0-0]{3,4}"/>?

Cheers,
Bryan Rasmussen



-----Oprindelig meddelelse-----
Fra: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]På vegne af Pete Cordell
Sendt: 16. marts 2007 16:44
Til: xmlschema-dev@w3.org
Emne: Schema 1.1: xs:anyEnumeration considered?



Continuing my exploration of extensibility...

One thing I often see are sets of enumerations that are not extensible.  I 
know that there is a trick with xs:union that you can do with this, but many 
people don't know about it and it is ugly.  Simply being able to mark a set 
of enumerations as extensible seems a lot cleaner to me.  For example, 
something along the lines of:

    <xs:simpleType name="foo">
        <xs:restriction base="xs:string">
            <xs:pattern value="[a-zA-Z0-0]{3,4}"/>
            <xs:enumeration value="ABC"/>
            <xs:enumeration value="DEFG"/>
            <xs:anyEnumeration/>  <!-- New -->
        </xs:restriction>
    </xs:simpleType>

Here the pattern restricts provides the bounds of what the anyEnumeration 
can permit.  (I thought about having a pattern attribute within the 
xs:anyEnumeration element, but the schema snippet above better reuses what's 
defined already.)

This very much more allows the developer to ask for what they want and 
doesn't require them to work around the limitations of the language with 
various insider tricks.

Going further, if named wildcards were allowed (as per my earlier topic in 
the week), the anyEnumeration facet could be:

            <xs:anyEnumeration socket="foo"/>

and in another schema you could have:

    <xs:plugin socket="core:foo">
        <xs:enumeration value="HIJ"/>
        <xs:enumeration value="KLMN"/>
    </xs:plugin>

>From what I understand, this sort of notation could go a long way to 
addressing the problems that Jon Bosak(sp?) described that UBL had with 
enumerations.

Anyway, the question is, was such a thing discussed?

Thanks,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx/
http://www.codalogic.com/lmx/
=============================================
Received on Monday, 19 March 2007 10:10:06 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.