Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

ADBMS-XML

VIEWS: 16 PAGES: 4

Database Mgmt system

More Info
									// Application.dtd:


<!ELEMENT   Application (resume+)>
<!ELEMENT   resume (name,age,marksOfGrad,university,post)>
<!ELEMENT   name (#PCDATA)>
<!ELEMENT   age (#PCDATA)>
<!ELEMENT   marksOfGrad (#PCDATA)>
<!ELEMENT   university (#PCDATA)>
<!ELEMENT   post (#PCDATA)>

// Application.xml:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE Application SYSTEM "Application.dtd">
<?xml-stylesheet href="Application.xsl" type="text/xsl"?>

<Application>

    <resume>
        <name>Rohit Kudva</name>
        <age>20</age>
        <marksOfGrad>1390</marksOfGrad>
        <university>V.E.S.I.T</university>
        <post>Executive head</post>
    </resume>

    <resume>
        <name>Khushal Navani</name>
        <age>19</age>
        <marksOfGrad>1490</marksOfGrad>
        <university>V.J.T.I</university>
        <post>Management head</post>
    </resume>

  <resume>
        <name>Rohit Tolani</name>
        <age>24</age>
        <marksOfGrad>1370</marksOfGrad>
        <university>Las.Vegas</university>
        <post> Bouncer</post>
    </resume>

    <resume>
        <name>Sanath Bhandary</name>
        <age>28</age>
        <marksOfGrad>1120</marksOfGrad>
        <university>St.Pius</university>
        <post>Canteen cook</post>
    </resume>

    <resume>
        <name>Aakash Bang</name>
        <age>20</age>
        <marksOfGrad>1290</marksOfGrad>
        <university>V.E.S.I.T</university>
        <post>Sports head</post>
    </resume>

    <resume>
        <name>Vatsal Mehta</name>
        <age>28</age>
        <marksOfGrad>1450</marksOfGrad>
        <university>V.E.S.I.T</university>
        <post>Marketing Head</post>
    </resume>

   <resume>
        <name>Harsh Asher</name>
        <age>20</age>
        <marksOfGrad>1600</marksOfGrad>
        <university>Father.Agnel</university>
        <post>Watchman</post>
    </resume>

</Application>

// Application.xsl:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">

<html>

<body bgcolor="cyan" text="black">



<table border="1" align="center" bordercolor="red">
<caption>Resume</caption>
<tr bgcolor="lime">
<th>Name</th>
<th>Age</th>
<th>Marks</th>
<th>University</th>
<th>Post</th>
</tr>

<xsl:for-each select="Application/resume">
<tr>
<td><xsl:value-of select="name" /></td>
<td><xsl:value-of select="age" /></td>
<td><xsl:value-of select="marksOfGrad" /></td>
<td><xsl:value-of select="university" /></td>
<td><xsl:value-of select="post" /></td>
</tr>

</xsl:for-each>
</table>

<br/><br/>



<table border="1" align="center" bordercolor="orange">
<caption>Sorted on the basis of name:</caption>
<tr bgcolor="lime">
<th>Name</th>
<th>Age</th>
<th>Marks</th>
<th>University</th>
<th>Post</th>
</tr>

<xsl:for-each select="Application/resume">
<xsl:sort select="name" />
<tr>
<td><xsl:value-of   select="name" /></td>
<td><xsl:value-of   select="age" /></td>
<td><xsl:value-of   select="marksOfGrad" /></td>
<td><xsl:value-of   select="university" /></td>
<td><xsl:value-of   select="post" /></td>
</tr>

</xsl:for-each>
</table>

<br/><br/>



<table border="1" align="center" bordercolor="green">
<caption>Sorted on the basis of Marks:</caption>
<tr bgcolor="lime">
<th>Name</th>
<th>Age</th>
<th>Marks</th>
<th>University</th>
<th>Post</th>
</tr>

<xsl:for-each select="Application/resume">
<xsl:sort select="marksOfGrad" />
<tr>
<td><xsl:value-of select="name" /></td>
<td><xsl:value-of select="age" /></td>
<td><xsl:value-of select="marksOfGrad" /></td>
<td><xsl:value-of select="university" /></td>
<td><xsl:value-of select="post" /></td>
</tr>

</xsl:for-each>
</table>

<br/><br/>



<table border="1" align="center" bordercolor="">
<caption>Marks greater than 1300</caption>
<tr bgcolor="lime">
<th>Name</th>
<th>Age</th>
<th>Marks</th>
<th>University</th>
<th>Post</th>
</tr>

<xsl:for-each select="Application/resume[marksOfGrad &gt;1300]">
<xsl:sort select="name" />
<tr>
<td><xsl:value-of select="name" /></td>
<td><xsl:value-of select="age" /></td>
<td><xsl:value-of select="marksOfGrad" /></td>
<td><xsl:value-of select="university" /></td>
<td><xsl:value-of select="post" /></td>
</tr>

</xsl:for-each>
</table>

</body>
</html>
</xsl:template>
</xsl:stylesheet>


/* OUTPUT:




*/

								
To top