employees.xml

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

<employee>
<first_name>Linda </first_name>
<middle_name>P.</middle_name>
<last_name>Jone</last_name>
<home_phone>386-333-2321</home_phone>
</employee>

<employee>
<first_name>Tom </first_name>
<last_name>Smith</last_name>
</employee>

<employee>
<first_name>Hilda </first_name>
<last_name>Parham</last_name>
<home_phone>386-455-5675</home_phone>
</employee>

</employees>

Create a DTD files “employee.dtd� based on “employees.xml�.

Create a schema files “employee.xsd� based on “employees.xml�.

Create a html page “employees.html� (15 points) and “employees.xsl� file, show the firstname, lastname.

To create a DTD file based on "employees.xml":

1. Open a text editor or an XML editor.
2. Save a new file with the name "employee.dtd".
3. Add the DTD declaration at the top of the file:

```
<!DOCTYPE employees SYSTEM "employee.dtd">
```

4. Define the structure of the XML document by specifying the elements, attributes, and their data types. Based on the provided "employees.xml" file, the DTD file can be defined as follows:

```xml
<!ELEMENT employees (employee*)>
<!ELEMENT employee (first_name, middle_name?, last_name, home_phone?)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT middle_name (#PCDATA)>
<!ELEMENT last_name (#PCDATA)>
<!ELEMENT home_phone (#PCDATA)>
```

Here, the elements within parentheses () represent the content model of the element. The "*"" denotes that the "employees" element can have multiple "employee" elements, and the "?" denotes that the elements "middle_name" and "home_phone" are optional.

5. Save the "employee.dtd" file.

To create a schema file based on "employees.xml":

1. Open a text editor or an XML editor.
2. Save a new file with the name "employee.xsd".
3. Add the schema declaration at the top of the file:

```xml
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="employees">
<!-- Add the rest of the schema definition here -->
</xsd:element>
</xsd:schema>
```

4. Inside the "employees" element, define the structure of the XML document using XML Schema language. Based on the provided "employees.xml" file, the schema file can be defined as follows:

```xml
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="employees">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="employee" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="first_name" type="xsd:string"/>
<xsd:element name="middle_name" type="xsd:string" minOccurs="0"/>
<xsd:element name="last_name" type="xsd:string"/>
<xsd:element name="home_phone" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
```

Here, the "xsd:string" type is used for all the elements.

5. Save the "employee.xsd" file.

To create an HTML page "employees.html" and an XSLT file "employees.xsl" to show the firstname and lastname:

1. Open a text editor.
2. Save a new file with the name "employees.html".
3. Inside the "employees.html" file, add the following HTML structure:

```html
<!DOCTYPE html>
<html>
<head>
<title>Employee List</title>
<link rel="stylesheet" type="text/css" href="employees.xsl"/>
</head>
<body>
<h1>Employee List</h1>
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="employees/employee">
<tr>
<td><xsl:value-of select="first_name"/></td>
<td><xsl:value-of select="last_name"/></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
```

4. Save the "employees.html" file.

5. Open another text editor.
6. Save a new file with the name "employees.xsl".
7. Inside the "employees.xsl" file, add the XSLT stylesheet declaration and define the transformation rules:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<title>Employee List</title>
<style>
/* Add any styling you want */
</style>
</head>
<body>
<h1>Employee List</h1>
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="employees/employee">
<tr>
<td><xsl:value-of select="first_name"/></td>
<td><xsl:value-of select="last_name"/></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
```

8. Save the "employees.xsl" file.

Now you have created the DTD file "employee.dtd", the schema file "employee.xsd", the HTML page "employees.html", and the XSLT file "employees.xsl" to display the firstname and lastname from the "employees.xml" file.