i write about problem that i have but now i show all code xml file
<?xml version="1.0"?>
<Purchase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://NamespaceTest.com/Purchase Main.xsd"
xmlns="http://NamespaceTest.com/Purchase">
<element style="ide">it can't contain other elements</element>
<element style="rem">it can contain some other <subelement>elements</subelement></element>
<element style="rem"> this style can contain other<subelement> elements</subelement></element>
</Purchase>
and Main.xsd file
<?xml version="1.0" encoding="utf-16"?>
<xs:schema elementFormDefault="qualified"
targetNamespace="http://NamespaceTest.com/Purchase"
xmlns:pur="http://NamespaceTest.com/Purchase"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Purchase">
<xs:complexType>
<xs:sequence>
<xs:group ref="pur:ide_group" maxOccurs="1"/>
<xs:group ref="pur:rem_group" maxOccurs="2" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="ide_group">
<xs:sequence>
<xs:element name="element" type="pur:ide_type"/>
</xs:sequence>
</xs:group>
<xs:complexType name="ide_type" mixed="true">
<xs:attribute name="style" type="pur:ide_list"/>
</xs:complexType>
<xs:simpleType name="ide_list">
<xs:restriction base="xs:token">
<xs:enumeration value="ide"/>
</xs:restriction>
</xs:simpleType>
<xs:group name="rem_group">
<xs:sequence>
<xs:element name="element" type="pur:rem_type"/>
</xs:sequence>
</xs:group>
<xs:complexType name="rem_type" mixed="true">
<xs:sequence>
<xs:element name="subelement"/>
</xs:sequence>
<xs:attribute name="style" type="pur:rem_list"/>
</xs:complexType>
<xs:simpleType name="rem_list">
<xs:restriction base="xs:token">
<xs:enumeration value="rem"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
i have error: cos-element-consistent: Error for type '#AnonType_Purchase'. Multiple elements with name 'element', with different types, appear in the model group. my problem is that xml file have elements with same name but different style, and i need make rule that depend on style of element.