tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
I have the following schema but when I try to validate it, using a tool such as:
I get an error message:
Here is the code:
Can someone tell me what is the problem?
Thanks
Code:
https://www.w3schools.com/xml/xml_validator.asp
I get an error message:
Code:
error on line 37 at column 17: opening and ending tag mismatch. sequence line 0 and element.
Here is the code:
Code:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.joe.bloggs.org/2020/XMLSchema" >
<xs:element name="Employee_Data" type="EmployeeDataType" />
<xs:complexType name="EmployeeDataType">
<xs:sequence>
<xs:element ref="Employee" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:element name="Employee" type="EmployeeType" />
<xs:complexType name="EmployeeType">
<xs:sequence >
<xs:element ref="Name" />
<xs:element ref="Age" />
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="120"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element ref="Start Date" />
<xs:element ref="Annual Income” />
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:double">
<xs:attribute name="currency">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Pounds" />
<xs:enumeration value="Euros" />
<xs:enumeration value="USdollars" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element ref="Department" />
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Sales"/>
<xs:enumeration value="Marketing"/>
<xs:enumeration value="IT"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Name" type="xs:string" />
<xs:element name="Start Date" type="xs:date" />
</xs:schema>
Can someone tell me what is the problem?
Thanks