Write a program to show the corresponding XSLT document which convert XML document into HTML format.
CODING:
.XML FILE:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="DHTML_XML4_9.xsl"?>
<info>
<student>
<roll>101</roll>
<name>Rakesh Sharma</name>
<marks>98</marks>
<result>Distinction</result>
</student>
<student>
<roll>102</roll>
<name>Parth Patel</name>
<marks>28</marks>
<result>Fail</result>
</student>
</info>
.XSL FILE:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="student">
<html>
<body style="margin-left: 50px">
Roll No - <xsl:value-of select="roll"/><br/>
Name - <xsl:value-of select="name"/><br/>
Marks - <xsl:value-of select="marks"/><br/>
Result - <xsl:value-of select="result"/><br/><br/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
CODING:
.XML FILE:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="DHTML_XML4_9.xsl"?>
<info>
<student>
<roll>101</roll>
<name>Rakesh Sharma</name>
<marks>98</marks>
<result>Distinction</result>
</student>
<student>
<roll>102</roll>
<name>Parth Patel</name>
<marks>28</marks>
<result>Fail</result>
</student>
</info>
.XSL FILE:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="student">
<html>
<body style="margin-left: 50px">
Roll No - <xsl:value-of select="roll"/><br/>
Name - <xsl:value-of select="name"/><br/>
Marks - <xsl:value-of select="marks"/><br/>
Result - <xsl:value-of select="result"/><br/><br/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Comments
Post a Comment