How do you define an element within a schema that has an attribute
For example in the following Offset has an attribute + a long value:
[code=xml]<Cue>
<Name>mycue</Name>
<Offset Kind="Start">0</Offset>
</Cue>[/code]
This doesn't work
[code=xml]<xs:element name="Cue">
<xs:complexType >
<xs:all>
<xs:element name="Name" type="xs:string "/>
<xs:element name="Offest">
<xs:complexType >
<xs:attribute name="Kind" type="TKind"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<xs:simpleTyp e name ="TKind">
<xs:restricti on base="xs:string ">
<xs:enumerati on value="End"/>
<xs:enumerati on value="Start"/>
</xs:restriction>
</xs:simpleType>[/code]
For example in the following Offset has an attribute + a long value:
[code=xml]<Cue>
<Name>mycue</Name>
<Offset Kind="Start">0</Offset>
</Cue>[/code]
This doesn't work
[code=xml]<xs:element name="Cue">
<xs:complexType >
<xs:all>
<xs:element name="Name" type="xs:string "/>
<xs:element name="Offest">
<xs:complexType >
<xs:attribute name="Kind" type="TKind"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<xs:simpleTyp e name ="TKind">
<xs:restricti on base="xs:string ">
<xs:enumerati on value="End"/>
<xs:enumerati on value="Start"/>
</xs:restriction>
</xs:simpleType>[/code]
Comment