|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: alternate enums in XML Schema
Having a distinct lexical and value for enumerations (ala enums in C++, Java) etc was suggested repeatedly and not take up in the W3C XML Schema process. Your syntax fragment looks like Microsoft XML-Data Reduced and not like W3C schema The idea was that you could do something like: <simpleType name="paymentMethod" base="integer"> <!-- open would allow for values not explicitly listed --> <enumeration open="true"> <value lexical="BNK" value="1"/> <value lexical="BNT" value="2"/> <value lexical="CBF" value="3"/> <value lexical="CHF" value="4"/> <value lexical="COM" value="5"/> </enumeration> </simpleType> In the current working draft, you can: <simpleType name="paymentMethod" base="string"> <enumeration value="BNK"/> <enumeration value="BNT"/> <enumeration value="CBF"/> <enumeration value="CHF"/> <enumeration value="COM"/> </simpleType> Which means that payment method is required to be one of the five declared types. If you want to add some information to the schema that an application can access, but is not used in validation, you can use an appinfo element. <simpleType name="paymentMethod" base="string"> <enumeration value="BNK"> <annotation> <appinfo> <myapp:enumeration value="1"/> </appinfo> </annotation> </enumeration> </simpleType> ... </simpleType> If you wanted to allow new values to be added dynamically, but wanted to provide some symbolic information for applications in the same resource, you could do <simpleType name="paymentMethod" base="integer"> <annotation> <appinfo> <myapp:symbol value="1" symbol="BNK"/> ... </appinfo> </annotation> </simpleType> *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








