Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Airline Reservation

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


<flights
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="flights.xsd">

<flight flightid="1">
<flightno>EK98</flightno>
<callsign>UAE98</callsign>
<airline>Emirates Airline</airline>

<plane planeid="1">
<name>Airbus A380-861</name>

<registereddate>07-06-10</registereddate>
</plane>

<registration>3A6-EDJ</registration>
<altitude height="feet">41000</altitude>
<speed ratio="mph">564</speed>
<distance unit="miles">erf</distance>

<route>
<routename>FCO-DXB</routename>
<from>
<iatacode>FCO</iatacode>

<airport>Fiumicino</airport>
<country>Italy</country>
<city>Rome</city>
<latitude>41.8044</latitude>
<longitude>12.2508</longitude>
</from>

<to>
<iatacode>DXB</iatacode>
<airport>Dubai Intl</airport>
<country>United Arab Emirates</country>
<city>Dubai</city>
<latitude>25.2528</latitude>
<longitude>55.3644</longitude>
</to>
</route>

<course bearing="degrees">154</course>

<journey>
<distance type="miles">2,697</distance>
<time>PT5H30M</time>
</journey>

</flight>

<flight flightid="2">
<flightno>BA283</flightno>
<callsign>BAW283</callsign>
<airline>British Airways</airline>

<plane planeid="2">
<name>Boeing 747-436</name>
<registereddate>06-12-97</registereddate>
</plane>

<registration>3A6-EDJ</registration>
<altitude height="feet">41000</altitude>
<speed ratio="mph">564</speed>
<distance unit="miles">erf</distance>

<route>
<routename>LHR-LAX</routename>
<from>
<iatacode>LHR</iatacode>
<airport>Heathrow</airport>
<country>England</country>
<city>London</city>
<latitude>51.4775</latitude>
<longitude>0.4614</longitude>

</from>

<to>
<iatacode>LAX</iatacode>
<airport>Los Angeles International</airport>
<country>United States of America</country>
<city>L.A</city>
<latitude>33.9471</latitude>
<longitude>-118.4082</longitude>
</to>
</route>
<course bearing="degrees">154</course>
<journey>
<distance type="miles">5,441 miles</distance>
<time>PT11H5M</time>
</journey>
</flight>
</flights>

Leap Year
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Leap Year</title>
<script type="text/javascript">
function checkLeapYear() {
var year = document.checkYear.year.value;
if (year / 4)
alert(year + " is a leap year.");
}
</script>
</head>
<body>
<form name="checkYear" action="" method="get">
<p><label for="year">Check Year</label>&nbsp;<input type="text" name="year"
id="year" />
<button type="button" onClick="checkLeapYear()">Check for Leap Year</button>
</p>
</form>

</body>
</html>

Blood Bank
<html>
<head>
<style>
table, th, td {

border: 1px solid black;


border-collapse:collapse;
}
th, td {
padding: 5px;
}
</style>
</head>
<body>
<h2> Blood Bank </h2> <br>
<script>
var x,i,xmlhttp,xmlDoc,table;
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "cd_catalog.xml", false);
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;
x = xmlDoc.getElementsByTagName("CD");
table="<tr><th>Artist</th><th>Title</th></tr>";
for (i = 0; i <x.length; i++) {
table += "<tr><td>" +
x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue +
"</td><td>" +
x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue +
"</td></tr>";
}
document.getElementById("demo").innerHTML = table;
</script>
</body>
</html>

cd_catalog.xml :
<CATALOG>
<CD>
<TITLE>O+ </TITLE>

<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>

<CD>
<TITLE>Ab- </TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
<CD>
<TITLE>O+</TITLE>
<ARTIST>Dolly Parton</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>RCA</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1982</YEAR>
</CD>
</CATALOG>

Display Cultural Events

<html>
<head>
<script language="JavaScript"
for="window" event="onload">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("note.xml")
nodes = xmlDoc.documentElement.childNodes
to.innerText = nodes.item(0).text
from.innerText = nodes.item(1).text
header.innerText = nodes.item(2).text
body.innerText = nodes.item(3).text
</script>
<title>HTML using XML data</title>
</head>
<body bgcolor="yellow">
<h1>College Cultural Events Details</h1>

<b>Event Name : Spintora </b><span id="to"></span>


<br>
<h1><b> Different Events : <br> <br> </h1>
1. Quiz <br> <br>
2. Gaming <br> <br>

3. DeBugging <br> <br>


4. Pop up Dance <br> <br>
5. Sing and Win <br> <br>
6. Fun Games <br>
</b><span id="from"></span>
<hr>
<b><span id="header"></span></b>
<hr>
<span id="body"></span>
</body>
</html>

You might also like