Here is my schema and xml file contents.
When I want to validate my xml file with my schema file I got the error:Element X1 is not defined in this scope.
Error line: 25
Error column: 12.
Where is the problem?
<xs:complexType name="LabelType">
<xs:sequence>
<xs:element name="Text" type="xs:string"/>
<xs:element name="X" type="xs:short"/>
<xs:element name="Y" type="xs:short"/>
<xs:element name="RotateAngle" type="xs:short" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ItemType">
<xs:choice>
<xs:element name="Label" type="LabelType" minOccurs="0"></xs:element>
<xs:element name="X1" type="xs:short" minOccurs="0"></xs:element>
<xs:element name="Y1" type="xs:short" minOccurs="0"></xs:element>
<xs:element name="Normal" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Reverse" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="SwitchType" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="MANUEL|AUTO"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="X2" type="xs:short" minOccurs="0"></xs:element>
<xs:element name="Y2" type="xs:short" minOccurs="0"></xs:element>
<xs:element name="Signalization" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="YES|NO"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="RotateAngle" type="xs:short" minOccurs="0"></xs:element>
<xs:element name="Width" type="xs:short" minOccurs="0"></xs:element>
<xs:element name="Height" type="xs:short" minOccurs="0"></xs:element>
<xs:element name="Source" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="Item" type="ItemType" minOccurs="0"></xs:element>
</xs:choice>
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="SWITCH"/>
<xs:enumeration value="BLOCKSEGMENT"/>
<xs:enumeration value="SIGNAL"/>
<xs:enumeration value="GROUP"/>
<xs:enumeration value="LEVELCROSSING"/>
<xs:enumeration value="SIGN"/>
<xs:enumeration value="TRAINIDBOX"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ssid" type="xs:string" use="optional"/>
<xs:attribute name="blockId" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="IndicatorType">
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="SWITCHHEATERSSTATE"/>
<xs:enumeration value="SIGNALSDAYNIGHTMODE"/>
<xs:enumeration value="POWERSUPPLY"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:element name="FieldVisual">
<xs:complexType>
<xs:sequence>
<xs:element name="Region" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Indicators">
<xs:complexType>
<xs:sequence>
<xs:element name="Indicator" type="IndicatorType" maxOccurs="3"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Track">
<xs:complexType>
<xs:sequence>
<xs:element name="Item" type="ItemType" maxOccurs="unbounded"></xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="X" type="xs:integer" use="required"/>
<xs:attribute name="Y" type="xs:integer" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<FieldVisual>
<Region id="MIT" name="TEST">
<Indicators>
<Indicator id="MI@MIT" type="SWITCHHEATERSSTATE"/>
<Indicator id="SGG@MIT" type="SIGNALSDAYNIGHTMODE"/>
<Indicator id="GK@MIT" type="POWERSUPPLY"/>
</Indicators>
<Track id="TEST" X ="632" Y="0">
<Item id="D@MIT" type="SWITCH">
<Label>
<Text>D</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>US</Normal>
<Reverse>UU</Reverse>
<SwitchType>MANUEL</SwitchType>
</Item>
<Item id="$CI1@MIT" type="GROUP">
<Item id="3T.9@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>0</Y1>
<X2>60</X2>
<Y2>-60</Y2>
</Item>
<Item id="5S@MIT" type="BLOCKSEGMENT">
<Label>
<Text>(5S)</Text>
<X>110</X>
<Y>-135</Y>
</Label>
<X1>60</X1>
<Y1>-60</Y1>
<X2>120</X2>
<Y2>-120</Y2>
<Signalization>NO</Signalization>
</Item>
<Item id="3T.8@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>80</X2>
<Y2>15</Y2>
</Item>
<Item id="SGN1@MIT" type="SIGN">
<X1>90</X1>
<Y1>-5</Y1>
<RotateAngle>180</RotateAngle>
</Item>
</Item>
<Item id="4S@MIT" type="BLOCKSEGMENT">
<Label>
<Text>(4S)</Text>
<X>85</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>180</X2>
<Y2>15</Y2>
<Signalization>NO</Signalization>
</Item>
<Item id="$CI2@MIT" type="GROUP">
<Item id="53T.8@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>80</X2>
<Y2>15</Y2>
</Item>
<Item id="56D@MIT" type="SIGNAL">
<Label>
<Text>56D</Text>
<X>10</X>
<Y>30</Y>
<RotateAngle>90</RotateAngle>
</Label>
<X1>0</X1>
<Y1>20</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3lr</Source>
</Item>
<Item id="53T.9@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>80</X1>
<Y1>0</Y1>
<X2>20</X2>
<Y2>-60</Y2>
</Item>
<Item id="SGN2@MIT" type="SIGN">
<X1>5</X1>
<Y1>-65</Y1>
<RotateAngle>45</RotateAngle>
</Item>
<Item id="6S@MIT" type="BLOCKSEGMENT">
<Label>
<Text>(6S)</Text>
<X>-50</X>
<Y>-135</Y>
</Label>
<X1>20</X1>
<Y1>-60</Y1>
<X2>-40</X2>
<Y2>-120</Y2>
<Signalization>NO</Signalization>
</Item>
</Item>
<Item id="59@MIT" type="SWITCH">
<Label>
<Text>59</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>US</Reverse>
</Item>
<Item id="61@MIT" type="SWITCH">
<Label>
<Text>61</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>SD</Reverse>
</Item>
<Item id="$CI17@MIT" type="GROUP">
<Item id="59T@MIT" type="BLOCKSEGMENT">
<Label>
<Text>59T</Text>
<X>85</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>180</X2>
<Y2>15</Y2>
</Item>
<Item id="56B@MIT" type="SIGNAL">
<Label>
<Text>56B</Text>
<X>155</X>
<Y>-15</Y>
</Label>
<X1>145</X1>
<Y1>0</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3rl</Source>
</Item>
</Item>
<Item id="003D@MIT" type="BLOCKSEGMENT">
<Label>
<Text>(003D)</Text>
<X>45</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>100</X2>
<Y2>15</Y2>
<Signalization>NO</Signalization>
</Item>
</Track>
<Track id="TEST" X="542" Y="90">
<Item id="5@MIT" ssid="05@MIT" type="SWITCH">
<Label>
<Text>5</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>UU</Normal>
<Reverse>US</Reverse>
</Item>
<Item id="$CI3@MIT" type="GROUP">
<Item id ="3T.6@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>130</X2>
<Y2>15</Y2>
</Item>
<Item id="2BB@MIT" type="SIGNAL">
<Label>
<Text>2BB</Text>
<X>100</X>
<Y>-15</Y>
</Label>
<X1>95</X1>
<Y1>0</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3rl</Source>
</Item>
<Item id ="3T.7@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>0</Y1>
<X2>60</X2>
<Y2>-60</Y2>
</Item>
</Item>
<Item id="3ST@MIT" type="BLOCKSEGMENT">
<Label>
<Text>3ST</Text>
<X>130</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>320</X2>
<Y2>15</Y2>
</Item>
<Item id="$CI4@MIT" type="GROUP">
<Item id="52DB@MIT" type="SIGNAL">
<Label>
<Text>52DB</Text>
<X>5</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>20</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3lr</Source>
</Item>
<Item id="53T.6" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>100</X2>
<Y2>15</Y2>
</Item>
</Item>
<Item id="57@MIT" type="SWITCH">
<Label>
<Text>57</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>DD</Normal>
<Reverse>SD</Reverse>
</Item>
<Item id="53T.7" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>-30</X1>
<Y1>0</Y1>
<X2>-90</X2>
<Y2>-60</Y2>
</Item>
</Track>
<Track id="TEST" X="19" Y="180">
<Item id="$CI5@MIT" type="GROUP">
<Item id="001BT@MIT" type="BLOCKSEGMENT">
<Label>
<Text>001BT</Text>
<X>70</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
</Item>
<Item id="B2D@MIT" type="SIGNAL">
<Label>
<Text>B2D</Text>
<X>15</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>20</Y1>
<Width>40</Width>
<Height>10</Height>
<Source>sgt3lr</Source>
</Item>
</Item>
<Item id="$CI6@MIT" type="GROUP">
<Item id="3T.1@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
</Item>
<Item id="HZM1@MIT" type="LEVELCROSSING">
<X1>60</X1>
<Y1>-80</Y1>
</Item>
<Item id="$3T.TIB@MIT" type="TRAINIDBOX">
<X1>10</X1>
<Y1>-20</Y1>
</Item>
<Item id="2D@MIT" type="SIGNAL">
<Label>
<Text>2D</Text>
<X>20</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>20</Y1>
<Width>50</Width>
<Height>10</Height>
<Source>sgt4lr</Source>
</Item>
</Item>
<Item id="1A@MIT" ssid="01@MIT" type="SWITCH">
<Label>
<Text>1A</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>SD</Reverse>
</Item>
<Item id="$CI7@MIT" type="GROUP">
<Item id ="3T.2@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<Label>
<Text>3T</Text>
<X>30</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>100</X2>
<Y2>15</Y2>
</Item>
<Item id ="3T.4@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>30</Y1>
<X2>30</X2>
<Y2>60</Y2>
</Item>
</Item>
<Item id="3@MIT" ssid="03@MIT" type="SWITCH">
<Label>
<Text>3</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SU</Normal>
<Reverse>SS</Reverse>
</Item>
<Item id="$CI8@MIT" type="GROUP">
<Item id="3T.3@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
</Item>
<Item id="2BA@MIT" type="SIGNAL">
<Label>
<Text>2BA</Text>
<X>120</X>
<Y>30</Y>
</Label>
<X1>110</X1>
<Y1>20</Y1>
<Width>40</Width>
<Height>10</Height>
<Source>sgt3rl</Source>
</Item>
<Item id="3T.5@MIT" blockId="3T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>0</Y1>
<X2>60</X2>
<Y2>-60</Y2>
</Item>
</Item>
<Item id="2ST@MIT" type="BLOCKSEGMENT">
<Label>
<Text>2ST</Text>
<X>145</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>300</X2>
<Y2>15</Y2>
</Item>
<Item id="$CI9@MIT" type="GROUP">
<Item id="53T.4@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
</Item>
<Item id="53T.5@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>150</X1>
<Y1>30</Y1>
<X2>120</X2>
<Y2>60</Y2>
</Item>
<Item id="52DA@MIT" type="SIGNAL">
<Label>
<Text>52DA</Text>
<X>20</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>20</Y1>
<Width>50</Width>
<Height>10</Height>
<Source>sgt4lr</Source>
</Item>
</Item>
<Item id="55A@MIT" ssid="55@MIT" type="SWITCH">
<Label>
<Text>55A</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>US</Reverse>
</Item>
<Item id="$CI10@MIT" type="GROUP">
<Item id="53T.3@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>98</X2>
<Y2>15</Y2>
</Item>
<Item id="53T.6@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>98</X1>
<Y1>0</Y1>
<X2>38</X2>
<Y2>-60</Y2>
</Item>
</Item>
<Item id="53@MIT" type="SWITCH">
<Label>
<Text>53</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>US</Reverse>
</Item>
<Item id="51B@MIT" ssid="51@MIT" type="SWITCH">
<Label>
<Text>51B</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>SD</Reverse>
</Item>
<Item id="$CI11@MIT" type="GROUP">
<Item id="53T.1@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<Label>
<Text>53T</Text>
<X>20</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
</Item>
<Item id="52B@MIT" type="SIGNAL">
<Label>
<Text>52B</Text>
<X>120</X>
<Y>-15</Y>
</Label>
<X1>100</X1>
<Y1>0</Y1>
<Width>50</Width>
<Height>10</Height>
<Source>sgt4rl</Source>
</Item>
<Item id="53T.2@MIT" blockId="53T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>30</Y1>
<X2>30</X2>
<Y2>60</Y2>
</Item>
</Item>
<Item id="$CI12@MIT" type="GROUP">
<Item id="001DT@MIT" type="BLOCKSEGMENT">
<Label>
<Text>001DT</Text>
<X>60</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
</Item>
<Item id="D52B@MIT" type="SIGNAL">
<Label>
<Text>D52B</Text>
<X>115</X>
<Y>-15</Y>
</Label>
<X1>110</X1>
<Y1>0</Y1>
<Width>40</Width>
<Height>10</Height>
<Source>sgt3rl</Source>
</Item>
</Item>
</Track>
<Track id="TEST" X="19" Y="270">
<Item id="(002B)@MIT" type="BLOCKSEGMENT">
<Label>
<Text>(002B)</Text>
<X>70</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
<Signalization>NO</Signalization>
</Item>
<Item id="$CI13@MIT" type="GROUP">
<Item id="1T.1@MIT" blockId="1T@MIT" type="BLOCKSEGMENT">
<Label>
<Text>1T</Text>
<X>116</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>242</X2>
<Y2>15</Y2>
</Item>
<Item id="4D@MIT" type="SIGNAL">
<Label>
<Text>4D</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>20</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3lr</Source>
</Item>
<Item id="1T.2@MIT" blockId="1T@MIT" type="BLOCKSEGMENT">
<X1>242</X1>
<Y1>0</Y1>
<X2>214</X2>
<Y2>-28</Y2>
</Item>
</Item>
<Item id="1B@MIT" ssid="01@MIT" type="SWITCH">
<Label>
<Text>1B</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>DS</Normal>
<Reverse>DD</Reverse>
</Item>
<Item id="$CI14@MIT" type="GROUP">
<Item id="1T.3@MIT" blockId="1T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>185</X2>
<Y2>15</Y2>
</Item>
<Item id="4B@MIT" type="SIGNAL">
<Label>
<Text>4B</Text>
<X>160</X>
<Y>-15</Y>
</Label>
<X1>150</X1>
<Y1>0</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3rl</Source>
</Item>
</Item>
<Item id="1ST@MIT" type="BLOCKSEGMENT">
<Label>
<Text>1ST</Text>
<X>145</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>300</X2>
<Y2>15</Y2>
</Item>
<Item id="$CI14@MIT" type="GROUP">
<Item id="51T.5@MIT" blockId="51T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>62</X2>
<Y2>15</Y2>
</Item>
<Item id="54D@MIT" type="SIGNAL">
<Label>
<Text>54D</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>20</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3lr</Source>
</Item>
</Item>
<Item id="55B@MIT" ssid="55@MIT" type="SWITCH">
<Label>
<Text>55B</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>SU</Reverse>
</Item>
<Item id="$CI15@MIT" type="GROUP">
<Item id="51T.4@MIT" blockId="51T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>0</Y1>
<X2>28</X2>
<Y2>-28</Y2>
</Item>
<Item id="51T.3@MIT" blockId="51T@MIT" type="BLOCKSEGMENT">
<Label>
<Text>51T</Text>
<X>135</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>314</X2>
<Y2>15</Y2>
</Item>
<Item id="51T.2@MIT" blockId="51T@MIT" type="BLOCKSEGMENT">
<X1>314</X1>
<Y1>0</Y1>
<X2>286</X2>
<Y2>-28</Y2>
</Item>
</Item>
<Item id="51A@MIT" ssid="51@MIT" type="SWITCH">
<Label>
<Text>51A</Text>
<X>10</X>
<Y>30</Y>
</Label>
<X1>0</X1>
<Y1>0</Y1>
<Normal>SS</Normal>
<Reverse>US</Reverse>
</Item>
<Item id="$CI16@MIT" type="GROUP">
<Item id="51T.1@MIT" blockId="51T@MIT" type="BLOCKSEGMENT">
<X1>0</X1>
<Y1>15</Y1>
<X2>60</X2>
<Y2>15</Y2>
</Item>
<Item id="54B@MIT" type="SIGNAL">
<Label>
<Text>54B</Text>
<X>35</X>
<Y>-15</Y>
</Label>
<X1>25</X1>
<Y1>0</Y1>
<Width>35</Width>
<Height>10</Height>
<Source>sgs3rl</Source>
</Item>
</Item>
<Item id="002D@MIT" type="BLOCKSEGMENT">
<Label>
<Text>(002D)</Text>
<X>70</X>
<Y>-5</Y>
</Label>
<X1>0</X1>
<Y1>15</Y1>
<X2>150</X2>
<Y2>15</Y2>
<Signalization>NO</Signalization>
</Item>
</Track>
</Region>
</FieldVisual>