Wednesday, 24 April 2013
Web Technology - XML and XSTL - how to run xml - XML stylesheet
XSL FILE
<html>
<body>
<h2 style="color:darkorange" > Students database</h2>
<table border="2">
<tr bgcolor="FF6600" style="color:white">
<th >Name</th>
<th>Address</th>
<th>Standards</th>
<th>marks</th>
</tr>
<xsl:for-each select="student/persondetails">
<tr bgcolor="888888" style="color:white">
<td>
<xsl:value-of select="name"/>
</td>
<td>
<xsl:value-of select="address"/>
</td>
<td>
<xsl:value-of select="std"/>
</td>
<td>
<xsl:value-of select="marks"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XML FILE
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="simplexml.xsl"?>
<student>
<persondetails>
<name>Anand</name>
<address>Pune</address>
<std>Second</std>
<marks>100</marks>
</persondetails>
<persondetails>
<name>Anu</name>
<address>chennai</address>
<std>tenth</std>
<marks>100</marks>
</persondetails>
<persondetails>
<name>Priya</name>
<address>mumbai</address>
<std>fifth</std>
<marks>60</marks>
</persondetails>
</student>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment