SRIVIDHYASARADHA ( 312216205105)
Implement XML – XML Schema XSLT/XSL.
Program Code:-
cdcatalog.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<catalog>
<cd>
<title>Chayya Chayya</title>
<artist>A R Rahman</artist></cd>
<cd>
<title>Hide your hear</title>
<artist>Bonnie Tyler</artist>
</cd>
<cd>
<title>Jiya Jale</title>
<artist>A R Rahman</artist>
</cd>
<cd>
<title>Shubarambh</title>
<artist>Shankar</artist>
</cd>
<cd>
<title>Surmayee Akhiyon me</title>
<artist>Gulzar</artist>
</cd>
<cd>
<title>Mandram Vandha Thendral</title>
<artist>Illayaraja</artist>
</cd>
<cd>
<title>Hey Ram</title>
<artist>Illayaraja</artist>
</cd>
</catalog>
cdcatalog.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">Title</th>
<th style="text-align:left">Artist</th>
</tr>
SRIVIDHYASARADHA ( 312216205105)
<xsl:for-each select="catalog/cd">
<tr>
<td>
<xsl:value-of select="title"/>
</td>
<td>
<xsl:value-of select="artist"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT :-
Implement XML – XMLDTD – CSS
Program Code:-
cssemployee.css
employee
{
background-color: pink;
}
SRIVIDHYASARADHA ( 312216205105)
firstname,lastname,email
{
font-size:25px;
display:block;
color: blue;
margin-left: 50px;
}
employee.dtd
<!ELEMENT employee (firstname,lastname,email)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ELEMENT email (#PCDATA)>
employee.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="cssemployee.css"?>
<!DOCTYPE employee SYSTEM "employee.dtd">
<employee>
<firstname>Srividhyasaradha</firstname>
<lastname>Kumarasubramanian</lastname>
<email>[email protected]</email>
</employee>
OUTPUT :-