The answer provided by @Sprotty is correct (+1). I would add refinements / options that do not fit into the comments (hence the answer) ...
Typically, the reason that only a simple type has been reused by Sprotty is because attributes are usually not qualified in XSD. Since the attributes are unqualified in your example, reusing the entire attribute is only possible if the attribute is enclosed in an attribute group. Basically, reusing an attribute defined globally means qualifying the attribute.
So, this is another opportunity to reuse an attribute declaration (as opposed to a simple type):
<?xml version="1.0" encoding="UTF-16"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="FlowBi:Emis:FeatureTests" xmlns="FlowBi:Emis:FeatureTests" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="featureTests"> <xs:complexType> <xs:sequence> <xs:element name="test" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="summary" type="xs:string"/> <xs:sequence> <xs:element name="step" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attributeGroup ref="gaStatus" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:sequence> <xs:attributeGroup ref="gaStatus" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:attributeGroup name="gaStatus"> <xs:attribute name="status" use="required"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="not run"/> <xs:enumeration value="passed"/> <xs:enumeration value="failed"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:attributeGroup> </xs:schema>
source share