Implementation of XML, DTD and XSLT
Implementation of XML, DTD and XSLT
Implementation of XML, DTD and XSLT
bookstore.xml:
<bookstore>
<book>
<title>Fundamentals of DB Systems</title>
<author>S. B. Navathe</author>
<language>English</language>
<price>Rs.540</price>
<publication>Pearson</publication>
</book>
<book>
<title>Twilight</title>
<author>Stephnie Meyer</author>
<language>English</language>
<price>Rs.230</price>
<publication>Little,Brown and Co.</publication>
</book>
<book>
<title>Shakuntala</title>
<author>Kalidas</author>
<language>Sanskrit</language>
<price>Rs.429</price>
<publication>Sahitya Co.</publication>
</book>
<book>
<title>Shyamchi Aayee</title>
<author>Sane Guruji</author>
<language>Marathi</language>
<price>Rs.290</price>
<publication>Grantha Pub.</publication>
</book>
<book>
<title>Si Senor</title>
<author>De Franklin</author>
<language>Spanish</language>
<price>Rs.690</price>
<publication>Le Fang Pub.</publication>
</book>
<book>
<title>Shomar Bangla</title>
<author>R. V. Banarjee</author>
<language>Bengali</language>
<price>Rs.274</price>
<publication>B.R.Co.</publication>
</book>
</bookstore>
bookstore.dtd:
<!DOCTYPE bookstore[
<!ELEMENT bookstore (book)*>
<!ELEMENT book (publication|price|language|author|title)*>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT language (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT publication (#PCDATA)>
]>
bookstore.xsl:
<xsl:template match="/">
<html>
<head>
<title>bookstore.xsl</title>
</head>
<body>
<td><xsl:value-of select="author"/></td>
<td><xsl:value-of select="language"/></td>
<td><xsl:value-of select="price"/></td>
<td><xsl:value-of select="publication"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT: