0% found this document useful (0 votes)
32 views2 pages

Ex11 XML

Uploaded by

Surya Dharshini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

Ex11 XML

Uploaded by

Surya Dharshini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

TO DISPLAY THE STUDENT DETAILS USING XML

Xml:

<?xml version="1.0" encoding="UTF-8"?>

<students>
<student id="1">
<roll>1</roll>
<name>preethi</name>
<mark>97</mark>
</student>
<student id="2">
<roll>2</roll>
<name>Rajan</name>
<mark>96</mark>
</student>
<student id="3">
<roll>3</roll>
<name>Varsaa</name>
<mark>15</mark>
</student>
</students>

XlsStylesheet:

<?xml version="1.0" encoding="UTF-8"?>


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>newstylesheet.xsl</title>
</head>
<body>
<table border="1">
<tr>
<th>RollNo</th>
<th>Name</th>
<th>Mark</th>
</tr>
<xsl:for-each select="students/student">
<tr>
<td><xsl:value-of select="roll"/></td>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="mark"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

OUTPUT:

You might also like