301P Solution File
301P Solution File
Marks 20
You are required to write XML code for the following description of a software house.
<company>: This is the root element representing the software house company.
o <name>: Specifies the name of the company.
o <location>: Contains information about the company's location.
<city>: Specifies the city where the company is located.
<country>: Specifies the country where the company is located.
o <departments>: Contains a list of departments within the company.
<department>: Represents a single department within the company.
<name>: Specifies the name of the department.
<employees>: Contains a list of employees within the
department.
<employee>: Represents a single employee within the
department.
<name>: Specifies the name of the employee.
<position>: Specifies the position or role of the
employee.
o <projects>: Contains a list of projects being undertaken by the company.
<project>: Represents a single project.
<name>: Specifies the name of the project.
<department>: Specifies the department responsible for the
project.
<status>: Specifies the current status of the project (e.g., "In
Progress", "Completed").
Note: You can take any data to write in xml code as text i.e
<location>
<city>
Faisalabad
</city>
</location>
Answer:
<?xml version="1.0" encoding="UTF-8"?>
<company>
<name>Faizan software house</name> <location>
<city>Faisalabad</city> <country>Pakistan</country> </location>
<departments>
<department>
<name>Development</name>
<employees>
<employee>
<name>Ali Yousaf</name>
<position>Software Developer</position>
</employee>
</employees>
</department>
<department>
<name>Marketing</name>
<employees>
<employee>
<name>Rehan Ali</name>
<position>Marketing Manager</position>
</employee>
</employees>
</department>
</departments>
<projects>
<project>
<name>Project No 03</name>
<department> WEB Development</department>
<status>In Progress</status>
</project>
</projects>
</company>