Altova Mailing List Archives
>xmlschema-dev Archive Home
>Thread Prev - Using types from the S4S
>Thread Next - Re: Atleast one element should be present in ComplexType.
attribute and restriction under same roof
Date: 3/28/2003 12:20:00 PM
Hi all, I have the following element inside a xsd:sequence. <xsd:element name="RuleType"> <xsd:annotation> <xsd:documentation>The type of the rule that caused the event.</xsd:documentation> </xsd:annotation> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Agent service control"/> <xsd:enumeration value="Application analyzer"/> <xsd:enumeration value="Application control"/> <xsd:enumeration value="Buffer overflow"/> </xsd:restriction> </xsd:simpleType> </xsd:element> I would like to add an attribute to this element as shown below <xsd:attribute name="RuleTypeNum" type="xsd:integer" use="required"/> I have tried playing with all simpleType, complexType, simpleContent and complexContent and cant seem to get it right. XMLSpy complains about one thing or another. Whats a good element type under which xsd:restriction and xsd:attribute can live together in harmony ? I have even tried adding xsd:attribute under xsd:restriction. Priscilla Walmsley's Definitive XML Schema (Appendix A, pg 486) says that restriction can be a parent to attribute for a local attribute definition. But XMLSpy">XMLSpy complains about it and says its unexpected. I need your suggestions. I want to be able to do this <RuleType RuleTypeNum=4>Buffer overflow</RuleType> Thanks, Venkat From xmlschema-dev-request@t... Fri Mar 28 19:23:27 2003 Received: from