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

Re: How to get enumeration values in alphabetical order

From: <noah_mendelsohn@us.ibm.com>
Date: Tue, 13 Mar 2007 09:49:19 -0400
To: "Swayam Vemuri -X \(swvemuri - WIPRO at Cisco\)" <swvemuri@cisco.com>
Cc: xmlschema-dev@w3.org, xmlschema-dev-request@w3.org
Message-ID: <OFDBA43844.6F5EA314-ON8525729D.004B85D8-8525729D.004BEE15@lotus.com>
I'm not sure what you mean by "getting" enumeration values.  If you want 
to do something like extract them from the schema itself, well schema 
documents are themselves XML documents, so you could run a stylesheet over 
your schema document.  Are you looking for something like:

        <element name="container">
                <element ref="e" type="someEnumeration" maxOccurs="*"/>

and to insist that the values of e occur alphabetically.  The answer in 
Schema 1.0 is no, can't do it.  In schema 1.1, the new "Assertions" 
facility would let you put an XPath assertion on the container.  If your 
processor supported a sufficiently broad subset of the XPath language, and 
if your definition of "alphatbetical order" involves a string comparision 
that XPath can easily do, then yes, I think you could enforce that in XML 
Schema 1.1.


[1] http://www.w3.org/TR/xmlschema11-1/#cAssertions

Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142

"Swayam Vemuri -X \(swvemuri - WIPRO at Cisco\)" <swvemuri@cisco.com>
Sent by: xmlschema-dev-request@w3.org
03/13/2007 09:26 AM
        To:     <xmlschema-dev@w3.org>
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        How to get enumeration values in alphabetical 

How to get enumeration values in alphabetical order.
Is there any way, pl let me know
Received on Tuesday, 13 March 2007 13:50:02 UTC

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