0% found this document useful (0 votes)
43 views3 pages

Implement XML - XML Schema XSLT/XSL. Program Code:-Cdcatalog - XML

The document implements XML and XSLT to display a CD catalog. It contains an XML file (cdcatalog.xml) that lists CD titles and artists. It also contains an XSL stylesheet (cdcatalog.xsl) that transforms the XML into an HTML table displaying the catalog. When opened in a browser, it outputs an HTML page with a table listing the titles and artists from the XML file.

Uploaded by

Anu Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views3 pages

Implement XML - XML Schema XSLT/XSL. Program Code:-Cdcatalog - XML

The document implements XML and XSLT to display a CD catalog. It contains an XML file (cdcatalog.xml) that lists CD titles and artists. It also contains an XSL stylesheet (cdcatalog.xsl) that transforms the XML into an HTML table displaying the catalog. When opened in a browser, it outputs an HTML page with a table listing the titles and artists from the XML file.

Uploaded by

Anu Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 3

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 :-

You might also like