Assignment 3
Assignment 3
Assignment No. 03
Title s:Designing XML Document for Employee Information Storage and Display
Objective : Design of an XML document to store employee information, along with the
implementation of validation techniques using both DTD and XML Schema
Problem Statement:
The task involves designing an XML document to efficiently store the information of
employees within a business organization. Additionally, the assignment requires the
demonstration of two different methods of ensuring the validity and structure of the
XML document: Document Type Definition (DTD) and XML Schema. Furthermore,
it necessitates the presentation of the stored content in a visually appealing format,
such as tabular, by utilizing CSS/XSL.
Requirements :
a) Design an XML document structure to store employee information including
attributes like name, ID, position, department, and contact details.
b) Develop a DTD file to define the structure and constraints of the XML document.
c) Create an XML Schema to validate the XML document's structure, data types, and
constraints.
d) Implement CSS/XSL to style and transform the XML content into a tabular format for
display.
Theory :
XML (Extensible Markup Language) serves as a versatile tool for structuring and storing data
in a hierarchical format. It allows for the creation of customized tags and attributes to
represent various types of information. XML documents consist of elements, attributes, and
text, organized in a tree-like structure. Elements represent the hierarchical structure of the
data, attributes provide additional information about elements, and text nodes contain the
actual data.
Explanation :
1. XML Document Design: The XML document will be structured to include elements
such as <employee>, <name>, <id>, <position>, <department>, and <contact>. Each
<employee> element will contain sub-elements representing different attributes of an
employee.
2. DTD Definition: The DTD file will specify the structure of the XML document using
element declarations, attribute lists, and entity definitions. It will enforce rules such as
required elements and data types.
3. XML Schema Creation: The XML Schema will be developed using the XSD syntax
to define the structure, data types, and constraints of the XML document. It will
provide a more robust validation mechanism compared to DTD.
4. CSS/XSL Implementation: CSS will be applied to style the XML content, while XSL
will be utilized to transform the structured data into a tabular format suitable for
display.
Conclusion/analysis :
In conclusion, the assignment involves the design of an XML document to store employee
information, along with the implementation of validation techniques using both DTD and
XML Schema. Additionally, it requires the presentation of the stored data in a tabular format
using CSS/XSL. This exercise not only demonstrates proficiency in XML technologies but
also showcases the ability to structure, validate, and present data effectively in different
formats.
Screen shots :
Program codes with sample output