[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Schema issue with enumerated element content
Hi, On Fri, 2005-11-18 at 13:24 -0700, russ@w... wrote: > Thanks Kasimier. I think I'll just move enumerations into attributes. > A little more complex for end users, but seemingly much better on the > schema end. The nice thing is that I learned - with the help of Henry's reply - that the following (which I copied from Henry's answer and modified a bit): <xs:simpleType name="vals"> <xs:list> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:list> </xs:simpleType> <xs:element name="ElemName"> <xs:complexType> <xs:simpleContent> <xs:extension base="vals"> <xs:attribute name="attr" type="xs:string"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> ... is the same as: <xs:element name="ElemName"> <xs:complexType> <xs:simpleContent> <xs:restriction base="xs:anyType"> <xs:simpleType> <xs:list> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:list> </xs:simpleType> <xs:attribute name="attr" type="xs:string"/> </xs:restriction> </xs:simpleContent> </xs:complexType> </xs:element> I'd prefer Henry's version - it looks easier to understand. Regards, Kasimier
|
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
|