Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

College of Computer and Information Sciences has many lecturers with different d

ID: 3811592 • Letter: C

Question

College of Computer and Information Sciences has many lecturers with different degrees such (Master, PhD, Prof) and other information. The following is XML tree that represent the problem: By giving the following constraints, write XML Schema. (XSD) with name (ccis.xsd) for the uploaded XML Document. There should be one or more lecturer Each lecturer has the following specifications: Each lecturer has a name, nationality, and Experience Name, nationality, Experience and Phone must appear in order. The lecturer may have zero or at most 3 phones. The Experience should be integer. Lecturer has a degree attribute and its default value is "phd'.

Explanation / Answer

XSD code :

<?xml version = "1.0"?>

<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
<xs:element name = 'ccis_college'>
<xs:complexType>
<xs:sequence>
<xs:element name = 'lecturer' type = 'lecturerType' minOccurs = '0' maxOccurs = 'unbounded' />
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name = "lecturerType">
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Nationality" type="xs:string"/>
<xs:element name="Experience" type="xs:integer"/>
   <xs:element name="Phone" type="xs:string" minOccurs = '0' maxOccurs = '3' />
   </xs:sequence>
  
   <xs:attribute name = "Degree" type = "xs:string" default = "phd"/>
</xs:complexType>             
</xs:schema>

XML :

<?xml version="1.0" encoding="UTF-8"?>

<ccis_college>
<lecturer>
<Name>John</Name>
<Nationality>Swedish</Nationality>
<Experience>1</Experience>
<Phone>12345678</Phone>
</lecturer>

<lecturer Degree="phd eco">
<Name>John</Name>
<Nationality>Swedish</Nationality>
<Experience>2</Experience>
</lecturer>
</ccis_college>