4 b)
Create an XSLT style sheet for one student element of the above document and use it to create a display of that element.
4b.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="4b.xsl"?>
<vtu>
<student>
<name>wxyz</name>
<usn>1ST10IS700</usn>
<collegeName>SaIT</collegeName>
<branch>ISE</branch>
<year>2010</year>
<email>wxyz@gmail.com</email>
</student>
</vtu>
4b.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<style>
.svalue{font-style:bold;font-size:20px;color:yellow;}
.shead{font-style:italic;font-size:20px;color:#DDFFCC;}
h2{color:white;}
body{background-color:silver;}
</style>
<h2>VTU Student Information</h2>
<table border="1">
<tr bgcolor="#CCCCCC">
<th><span class="svalue">Name </span></th>
<th><span class="svalue">Usn</span></th>
<th><span class="svalue">CollegeName</span></th>
<th><span class="svalue">Branch</span></th>
<th><span class="svalue">Year</span></th>
<th><span class="svalue">E-mail</span></th>
</tr>
<xsl:for-each select="vtu/student">
<tr>
<td><span class="shead"><xsl:value-of select="name"/></span></td>
<td><span class="shead"><xsl:value-of select = "usn" /></span></td>
<td><span class="shead"><xsl:value-of select="collegeName"/></span></td>
<td><span class="shead"><xsl:value-of select="branch"/></span></td>
<td><span class="shead"><xsl:value-of select="year"/></span></td>
<td><span class="shead"><xsl:value-of select="email"/></span></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Create an XSLT style sheet for one student element of the above document and use it to create a display of that element.
4b.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="4b.xsl"?>
<vtu>
<student>
<name>wxyz</name>
<usn>1ST10IS700</usn>
<collegeName>SaIT</collegeName>
<branch>ISE</branch>
<year>2010</year>
<email>wxyz@gmail.com</email>
</student>
</vtu>
4b.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<style>
.svalue{font-style:bold;font-size:20px;color:yellow;}
.shead{font-style:italic;font-size:20px;color:#DDFFCC;}
h2{color:white;}
body{background-color:silver;}
</style>
<h2>VTU Student Information</h2>
<table border="1">
<tr bgcolor="#CCCCCC">
<th><span class="svalue">Name </span></th>
<th><span class="svalue">Usn</span></th>
<th><span class="svalue">CollegeName</span></th>
<th><span class="svalue">Branch</span></th>
<th><span class="svalue">Year</span></th>
<th><span class="svalue">E-mail</span></th>
</tr>
<xsl:for-each select="vtu/student">
<tr>
<td><span class="shead"><xsl:value-of select="name"/></span></td>
<td><span class="shead"><xsl:value-of select = "usn" /></span></td>
<td><span class="shead"><xsl:value-of select="collegeName"/></span></td>
<td><span class="shead"><xsl:value-of select="branch"/></span></td>
<td><span class="shead"><xsl:value-of select="year"/></span></td>
<td><span class="shead"><xsl:value-of select="email"/></span></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
No comments:
Post a Comment