Ass 3
Ass 3
any business organization and demonstrate the use of: a) DTD b) XML Schema
And display the content in (e.g., tabular format) by using CSS/XSL.
<employees>
<employee>
<id>001</id>
<name>John Doe</name>
<designation>Software Engineer</designation>
<department>IT</department>
<salary>70000</salary>
</employee>
<employee>
<id>002</id>
<name>Jane Smith</name>
<designation>Marketing Manager</designation>
<department>Marketing</department>
<salary>80000</salary>
</employee>
</employees>
<!ELEMENT id (#PCDATA)>
<xs:element name="employees">
<xs:complexType>
<xs:sequence>
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<style>
body {
margin: 20px;
table {
border-collapse: collapse;
width: 100%;
th, td {
text-align: left;
padding: 8px;
th {
background-color: #f2f2f2;
</style>
<xsl:template match="/">
<html>
<head>
<title>Employee Data</title>
</head>
<body>
<h2>Employee Information</h2>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Designation</th>
<th>Department</th>
<th>Salary</th>
</tr>
<xsl:for-each select="employees/employee">
<tr>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="designation"/></td>
<td><xsl:value-of select="department"/></td>
<td><xsl:value-of select="salary"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>