W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

Schema 1.1: xs:anyEnumeration considered?

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Fri, 16 Mar 2007 15:44:02 -0000
Message-ID: <000d01c767e1$f22b1240$5900a8c0@Codalogic>
To: <xmlschema-dev@w3.org>

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 Friday, 16 March 2007 15:44:38 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:12 UTC