WT LAB
WT LAB
Task-1
Design HTML fundamental constructs
Headings:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
</body>
</html>
Output:
1
22A81A0624 Web Technologies Lab
Link:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
<h3>Links Example</h3>
</body>
</html>
Output:
2
22A81A0624 Web Technologies Lab
Paragraph:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
In the quiet hush of dawn, the city awoke with a tentative stretch,its streets still glistening with the
remnants of last night's rain.
A lone figure made its way through the labyrinth of alleys, their footsteps echoing softly against the
cobblestones.
Above, the sky shifted from a deep indigo to a pale wash of morning blue, promising a day of
possibilities.
Far away, the distant murmur of traffic began to grow,gradually punctuating the serene stillness of the
early hour.
</p>
</body>
</html>
Output:
3
22A81A0624 Web Technologies Lab
Table:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
<tr>
<th>DAY/PERIOD</th><th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th rowspan="7">Break</th>
<th>5</th>
<th>6</th>
<th>7</th></tr>
<tr>
<th>Mon</th>
<td>DM</td>
<td>AI</td>
</tr>
<tr>
4
22A81A0624 Web Technologies Lab
<th>Tue</th>
<td>OS</td>
<td>AI</td>
<td>WT</td>
<td>DM</td>
</tr>
<tr>
<th>WED</th>
<td>DM</td>
<td>LIB</td>
<td>AI</td>
<td>DM</td>
<td>SPORTS</td>
</tr>
<tr>
<th>THU</th>
<td>AI</td>
<td>OS</td>
<td>DM</td>
<td>OS</td>
</tr>
<tr>
5
22A81A0624 Web Technologies Lab
<th>FRI</th>
<td>DM</td>
<td>AI</td>
<td>OS</td>
<td>WT</td>
</tr>
<tr>
<th>SAT</th>
<td>WT</td>
<td>DM</td>
<td>AI</td>
</tr>
</table>
</body>
</html>
Output:
6
22A81A0624 Web Technologies Lab
Task-2
Design HTML fundamental constructs
Frames:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<frameset cols="50%,50%">
<frame src="a.html">
<frame src="b.html">
</frameset>
</html>
a.html:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
<h1>CST</h1>
</body>
</html>
7
22A81A0624 Web Technologies Lab
b.html:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
<h1>CLASS</h1>
</body>
</html>
Output:
8
22A81A0624 Web Technologies Lab
Forms and HTML Controls:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body bgcolor=pink>
<form align="center">
<td>
<tr>
<td><input type=text></td>
</tr>
<tr>
<td><input type=text></td>
</tr>
<tr>
<td align="left">Gender:</td>
</tr>
<tr>
9
22A81A0624 Web Technologies Lab
<td align="left">Email:</td>
<td><input type=text></td>
</tr>
<tr>
<td align="left">Password:</td>
<td><input type=password></td>
</tr>
<tr>
<tr>
<td align="left">Country:</td>
<td><select name=country>
<option>India</option>
<option>USA</option>
<option>Nepal</option>
<option>Srilanka</option>
</select></td>
</tr>
<tr>
<td><input type=text></td>
</tr>
<tr>
10
22A81A0624 Web Technologies Lab
<td>Day<select>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>Month
<select>
<option>Jan</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>Jun</option>
<option>Jul</option>
<option>Aug</option>
<option>Sep</option>
<option>Oct</option>
<option>Nov</option>
<option>Dec</option>
11
22A81A0624 Web Technologies Lab
</select>Year
<select>
<option>2001</option>
<option>2002</option>
<option>2003</option>
<option>2004</option>
<option>2005</option>
</select>
</td>
</tr>
<tr>
<td align="left">Hobbies:</td>
</tr>
<tr>
<td align="left">Address:</td>
</tr>
</table>
</td>
</table>
</form>
</body>
</html>
12
22A81A0624 Web Technologies Lab
Output:
13
22A81A0624 Web Technologies Lab
Task-3
Design Cascading Style Sheets
Internal CSS:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
<style type="text/css">
h1{
font-style: italic;
p{
background-color: yellow;
body{
background-color: pink;}
</style>
</head>
<body>
</body>
</html>
14
22A81A0624 Web Technologies Lab
Output:
15
22A81A0624 Web Technologies Lab
External CSS:
HTML file
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
<h1>This is H1 Tag</h1>
</body>
</html>
CSS File
body{
text-align: right;
h1{
font-size:30px;
color:tomato;
text-align:center;
p{
font-size:20px
16
22A81A0624 Web Technologies Lab
Output:
17
22A81A0624 Web Technologies Lab
In-Line CSS:
<!DOCTYPE html>
<html>
<head>
<title>22A81A0624</title>
</head>
<body>
<p style="color:blue;text-align:right">Paragraph</p>
</body>
</html>
Output:
18
22A81A0624 Web Technologies Lab
Task-4
Write an XML file which will display the Book information which includes the following:
bookstore.xml:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<title> C Programming</title>
<author>E.Balaguru Swamy</author>
<isbn>9856543210</isbn>
<publisher>Pearson Publications</publisher>
<edition>4th</edition>
<price currency="USD">$100</price>
</book>
<author>James Gosling</author>
<isbn>9856543288</isbn>
<publisher>Pearson Publications</publisher>
<edition>4th</edition>
</book>
19
22A81A0624 Web Technologies Lab
<book category="AI" language="English" availability="in_stock">
<author>Stuart J. Russell</author>
<isbn>9876543220</isbn>
<publisher>Princeton Hall</publisher>
<edition>6th</edition>
<price currency="USD">$36.09</price>
</book>
<title>XML Bible</title>
<isbn>9876543280</isbn>
<publisher>Hungry Minds</publisher>
<edition>4th</edition>
<price currency="USD">$21.99</price>
</book>
</bookstore>
Output:
20
22A81A0624 Web Technologies Lab
bookstore.dtd:
<!ELEMENT bookstore (book+)>
<!ATTLIST book
<!ATTLIST price
Output:
21
22A81A0624 Web Technologies Lab
Bookstore.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.com/bookstore"
targetNamespace="http://www.example.com/bookstore"
elementFormDefault="qualified">
<xs:element name="bookstore">
<xs:complexType>
<xs:sequence>
<xs:complexType>
<xs:sequence>
<xs:element name="price">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
22
22A81A0624 Web Technologies Lab
</xs:sequence>
<xs:attribute name="availability">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="in_stock"/>
<xs:enumeration value="out_of_stock"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Output:
23
22A81A0624 Web Technologies Lab
Bookstore.xsl:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Template to match the root element and create the HTML structure -->
<xsl:template match="/bookstore">
<html>
<head>
<title>Bookstore Inventory</title>
<style>
body {
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
table, th, td {
th, td {
padding: 8px;
text-align: left;
th {
background-color: #f4f4f4;
24
22A81A0624 Web Technologies Lab
}
tr:nth-child(even) {
background-color: #f9f9f9;
</style>
</head>
<body>
<h1>Bookstore Inventory</h1>
<table>
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>ISBN</th>
<th>Publisher</th>
<th>Edition</th>
<th>Price</th>
<th>Category</th>
<th>Language</th>
<th>Availability</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="book"/>
</tbody>
</table>
25
22A81A0624 Web Technologies Lab
</body>
</html>
</xsl:template>
<!-- Template to match each book element and create a table row -->
<xsl:template match="book">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="author"/></td>
<td><xsl:value-of select="isbn"/></td>
<td><xsl:value-of select="publisher"/></td>
<td><xsl:value-of select="edition"/></td>
<td>
<xsl:value-of select="price"/>
</td>
<td><xsl:value-of select="@category"/></td>
<td><xsl:value-of select="@language"/></td>
<td><xsl:value-of select="@availability"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
Output:
26
22A81A0624 Web Technologies Lab
27