PRACTICAL NO.
06
Aim: Write a HTML program to create a XML file with Internal/
External DTD and display it using CSS and XSL/
1. CSS:
INPUT:
<?xml version="1.0"encoding="UTF-8"standalone="yes"?>
<!DOCTYPE book[
<!ELEMENT book(bname,author,price)>
<!ELEMENTbname(#PCDATA)>
<!ELEMENT author(#PCDATA)>
<!ELEMENT price(#PCDATA)>
]>
<book>
<bname>Sanjeevani Babar</bname>
<author>TutorialsPoint</author>
<price>(011)123.4567</price>
</book>
OUTPUT:
2. XSL:
INPUT:
<?xml version="1.0"encoding="UTF-8"?>
-<xsl:stylesheetversion="1.0">
-<xsl:template match="/">
-<html>
-<body>
ROLL NO.:69
<h2>BOOKS DETAILS </h2>
-<table border="1">
-<trbgcolor="ffff000">
<th>BOOK ID</th>
<th>BOOK NAME</th>
<th>AUTHOR</th>
<th<PUBLISHER</th>
<th>PRICE</th>
</tr>
-<xsl:for-each select="class/book">
-<tr>
-<td>
<xsl:value-of select="@bid"/>
</td>
-<td>
<xsl:value-of select="bname"/>
</td>
-<td>
<xsl:value-of select="author"/>
</td>
-</td>
<xsl:value-of select="publisher"/>
</td>
-<td>
<xsl:value-of select="price"/>
</td>
ROLL NO.:69
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT:
ROLL NO.:69