cannot resolve the name "xs.string" to a(n) type definetion component

2k Views Asked by At

this is an assignment file. schema must be developed. XYZ school wants to store the details of student and staff in a xml file. The following scenario helps in designing the XML document. Persons will the root tag. Persons will have the entry of each person with name, age, gender, address. A person can be either a student or staff. student will have rollno, standard and section. If staff, then staffid and subject. Every student must have an address with the following entry- doorno,street,city and state.

`<?xml version = "1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="persons">
   <xs:complexType>
   <xs:sequence>
      <xs:element name="person">
        <xs:complexType>
        <xs:sequence>
            <xs:element name="name" type="xs.string"/>
            <xs:element name="age" type="xs.integer"/>
            <xs:element name="gender" type="xs.string"/>
              <xs:element name="address">
                <xs:complexType>
                <xs:sequence>
                    <xs:element name="doorno" type="xs.integer"/>
                    <xs:element name="street" type="xs.string"/>
                    <xs:element name="city" type="xs.string"/>
                    <xs:element name="state" type="xs.string"/>
                </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="student" minOccurs="0">
                <xs:complexType>
                <xs:sequence>
                    <xs:element name="rollno" type="xs.integer"/>
                    <xs:element name="standard" type="xs.integer"/>
                    <xs:element name="section" type="xs.string"/>
               </xs:sequence>
               </xs:complexType>
              </xs:element>
              <xs:element name="staff" minOccurs="0">
                <xs:complexType>
                <xs:sequence>
                    <xs:element name="staffid" type="xs.integer"/>
                    <xs:element name="subject" type="xs.string"/>
                </xs:sequence>
                </xs:complexType>
              </xs:element>
        </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    </xs:complexType>
</xs:element>
</xs:schema>`

could anyone please help me out.

1

There are 1 best solutions below

2
Michael Kay On

Change xs.string to xs:string.