Write a Java Program to implement Vector class and its methods.

import java.lang.*;
import java.util.Vector;
import java.util.Enumeration;
class vectordemo
{
public static void main(String arg[])
{
Vector v=new Vector();
v.addElement("one");
v.addElement("two");
v.addElement("three");
v.insertElementAt("zero",0);
v.insertElementAt("oops",3);
v.insertElementAt("four",5);
System.out.println("Vector Size :"+v.size());
System.out.println("Vector apacity :"+v.capacity());
System.out.println(" The elements of a vector are :");
Enumeration e=v.elements();
while(e.hasMoreElements())

CREATE A XSLT STYLE SHEET FOR ONE PATIENT

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href='a.xsl' type='text/xsl'?>

<patients>

<patient>
<name>
<fname>Vishwas</fname>
<mname>s</mname>
<lname>d</lname>
</name>
<ssn>054</ssn>
<age>20</age>
<rno>10</rno>
<insurance type="primary">
<id>001</id>
<gno>205</gno>
<addr>Shimoga</addr>
</insurance>
<insurance type="sec">
<id>202</id>
<gno>305</gno>
<addr>Shimoga</addr>
</insurance>
<mp>liver</mp>
<dg>nill</dg>
</patient>

</patients>

CREATE A CSS STYLE SHEET FOR XML PATIENTS DOCUMENT

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href='p.css' type='text/css'?>

<patients>

<patient>
<name>
<fname>Vishwas</fname>
<mname>s</mname>
<lname>d</lname>
</name>
<ssn>054</ssn>
<age>20</age>
<rno>10</rno>
<insurance type="primary">
<id>001</id>
<gno>205</gno>
<addr>Shimoga</addr>
</insurance>
<insurance type="sec">
<id>202</id>
<gno>305</gno>
<addr>Shimoga</addr>
</insurance>
<mp>liver</mp>
<dg>nill</dg>
</patient>

<patient>
<name>
<fname>Sharath</fname>
<mname>k</mname>
<lname>r</lname>
</name>
<ssn>053</ssn>
<age>21</age>
<rno>11</rno>
<insurance type="primary">
<id>002</id>
<gno>206</gno>
<addr>Shimoga</addr>
</insurance>
<insurance type="sec">
<id>203</id>
<gno>306</gno>
<addr>Shimoga</addr>
</insurance>
<mp>heart</mp>
<dg>nill</dg>
</patient>

<patient>
<name>
<fname>Guru</fname>
<mname>raj</mname>
<lname>a</lname>
</name>
<ssn>055</ssn>

XML DOCUMENT TO STORE INFO ABOUT PATIENTS

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

<patients>

<patient>
<name>
<fname>Vishwas</fname>
<mname>s</mname>
<lname>d</lname>
</name>
<ssn>054</ssn>
<age>20</age>
<rno>10</rno>
<instance type="primary">
<id>001</id>
<gno>205</gno>
<addr>Shimoga</addr>
</instance>
<instance type="sec">
<id>202</id>
<gno>305</gno>
<addr>Shimoga</addr>
</instance>
<mp>liver</mp>
<dg>nill</dg>
</patient>

<patient>
<name>
<fname>Sharath</fname>
<mname>k</mname>
<lname>r</lname>
</name>
<ssn>053</ssn>
<age>21</age>
<rno>11</rno>
<instance type="primary">
<id>002</id>
<gno>206</gno>
<addr>Shimoga</addr>
</instance>
<instance type="sec">
<id>203</id>
<gno>306</gno>

THE XHTML PROGRAM ILLUSTRATE CHANGING BACKGROUND AND FOREGROUND COLOUR DYNAMICALYY

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>changing color </title>
<script type="text/javascript" src="changecolor.js">
</script>
</head>
<body>
<p style="font-family:times; font-style=static;font-size=16pt;"> welcome to DSDNP </p>
<form action=" ">
<p>
Background color:<input type="text" id="bg" onchange="setbackcolor(this.value);" /> <br />
Foreground color:<input type="text" id="fg" onchange="setforecolor(this.value);" /> <br />
</p>
</form>
</body>
</html>




Changecolor.js
 function setbackcolor(bcolor)
{
document.body.style.backgroundColor=bcolor;
}

function setforecolor(fcolor)
{
document.body.style.Color=fcolor;
}


THE XHTML PROGRAM TO ILLUSTRATE STACK OF THE MESSAGE

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "_//w3c//DTD xhtml1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/html">
<head><title>Stacking of four paragraph</title>
<style type="text/css">
body
{
font-family:Times;
font-size:24pt;
}
#one{position:absolute;top:200px;left:300px;background-color:black;color:white;}
#two{position:absolute;top:220px;left:320px;background-color:cyan;color:black;}
#three{position:absolute;top:240px;left:340px;background-color:red;color:yellow;}
#four{position:absolute;top:260px;left:360px;background-color:green;color:orange;}
</style>
<script type="text/javascript">
var topLayer="three";
function movit(toTop)
{
var oldTop=document.getElementById(topLayer).style;
var newTop=document.getElementById(toTop).style;
oldTop.zIndex="0";
newTop.zIndex="10";
topLayer=document.getElementById(toTop).id;
}
</script></head>
<body>
<div id="one" onmouseover="movit('one')">
Apple may dominate<br/>
itv may take off in the market</div>
<div id="two" onmouseover="movit('two')">
Microsoft dominates<br/>
windows 8 is gettingpopular</div>
<div id="three" onmouseover="movit('three')">
google rocks<br/>
we all know that</div>
<div id="four" onmouseover="movit('four')">
web program rocks<br/>
we all know that</div>
</body>
</html>

THE XHTML PROGRAM TO ILLUSTRATE STACKING OF IMAGES WHEN MOUSE OVER THE IMAGE

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "_//w3c//DTD xhtml1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/html">
<head><title>Stacking of four paragraph</title>
<style type="text/css">
body
{
font-family:Times;
font-size:24pt;
}
#one{position:absolute;top:20px;left:20px;}
#two{position:absolute;top:40px;left:40px;}
#three{position:absolute;top:60px;left:60p;}
#four{position:absolute;top:120px;left:120px;}
</style>
<script type="text/javascript">
var topLayer="four";
function movit(toTop)
{
var oldTop=document.getElementById(topLayer).style;
var newTop=document.getElementById(toTop).style;
oldTop.zIndex="0";
newTop.zIndex="10";
topLayer=document.getElementById(toTop).id;
}
</script></head>
<body>
<img id="one" src="11.jpg" onmouseover="movit('one')"/>
<img id="two" src="4.jpg" onmouseover="movit('two')"/>
<img id="three" src="6.jpg" onmouseover="movit('three')"/>
<img id="four" src="5.jpg" onmouseover="movit('four')"/>
</body>
</html>