Certificate

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY

SCHOOL OF COMPUTER SCIENCE

Certificate

This is to certify Mr. / Ms. MORE RIDDHI RAGHUNATH

(PRN: _2019017000344355_) has successfully completed 14 / 14 practicals for the

course code CMP-708 having course name WEB TECHNOLOGIES of Semester IIIRD

of BACHELOR OF COMPUTER APPLICATIONS programme (programme code:P131)

, during the academic year 2020-2021.

_____________________________ __________________________
Name of the Counsellor Name of the SC Co-ordinator
Signature: ___________________ Signature: __________________ Date:
______________ Date: ______________

Seal of the Study Centre

_____________________________ __________________________
Name of the Internal Examiner Name of the External Examiner
Signature: ___________________ Signature: __________________ Date:
______________ Date: ______________

Stamp of the Exam Centre

YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY


SCHOOL OF COMPUTER SCIENCE

Index
No. Practical Date of Page Signature of the
Activities/Programs/Assignments practical No. Counsellor and
performed date
1. Practical No: 1
2. Practical No: 2
3. Practical No: 3
4. Practical No: 4
5. Practical No: 5
6. Practical No: 6
7. Practical No: 7
8. Practical No: 8
9. Practical No: 9
10. Practical No: 10
11. Practical No: 11
12. Practical No: 12
13. Practical No: 13
14. Practical No: 14
15.

PRACTICAL NO.1

Aim : Design a web page using different text formatting tags.

Code :

<html>

<head>

<title>Text formatting tags</title>

</head>

<body>
SYBCA ROLL NO.25
<h1>This is a heading.</h1>

<h2>This is a heading.</h2>

<h3>This is a heading.</h3>

<h4>This is a heading.</h4>

<h5>This is a heading.</h5>

<h6>This is a heading.</h6>

<p>This is <b>bold tag.</b>

<br />

This is paragragh tag.

<br />

This is <i>italic tag.</i>

<br />

This is <u>underline tag.</u>

<br />

This is<sup>superscript.</sup>

<br />

This is<sub>subscript</sub>

<br />

This is <strike>strikethrough.</strike>

WEB TECHNOLOGY
SYBCA ROLL NO.25
PRACTICAL NO.1

<br />

</p>

</body>

</html>

Output :

Aim : Design a web page with different types of Marquee.

Code :

<html>

<head>

<title>Marquee tag</title>

</head>

<body>

<marquee>

<h1>PATKAR VARDE COLLEGE</h1>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.2 ROLL NO.25
</marquee> <br />

<marquee behaviour = "alternate" loop = "5">

<h3>Welcome to I.T Lab</h3>

</marquee><br />

<marquee direction = "down">

<center><img src = "C:\Users\soham\Documents\a.jpg.jpg" width = "150" height =


"150"></center>

</marquee>

<marquee behaviour = "alternate" direction = "right" scroll delay = "500">

<img src = "C:\Users\soham\Documents\b.jpg.jpg" width = "150" height = "150">

</marquee>

<marquee behaviour = "alternate" direction = "left" scroll amount = "500">

<img src = "C:\Users\soham\Documents\c.jpg.jpg" width = "150" height = "150">

</marquee>

<marquee direction = "up">

<center><img src = "C:\Users\soham\Documents\d.jpg.jpg" width = "150" height = "150">

</center>

</marquee>

</body>

</html>

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.2 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.2 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.3 ROLL NO.25

Aim : Design a web page with links to different pages and allow navigation between pages.

Code :

For page 1:

Code :

<html>

<head>

<title>pract-3.1</title>

</head>

<body background = "1.jpg">

<h2><center>

<a href = "pract-3.1.html">Mercedez</a>&nbsp; || &nbsp;

<a href = "pract-3.2.html">Jaguar</a>&nbsp; || &nbsp;

<a href = "pract-3.3.html">Ferrari</a>&nbsp; || &nbsp;

<font face = "Segoe Print">

<h5>

<ul>

<li>Mercedez-Benz is a global automobile maufacture and a division of the German


company Daimler AG.</li>

<li>The brand is know for luxurious vehicles.</li>

<li>The headquarter is in Stuttgart, Baden-Wuttemberg Founded in 1926 by Karl Benz


.</li>

</h5>

</font>

</ul>

</body>

</html>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.3 ROLL NO.25

Output :

For page 2:

Code :

<html>

<head>

<title>pract-3.2</title>

</head>

<body background = "2.jpg">

<h2><center>

<a href = "pract-3.1.html">Mercedez</a>&nbsp; || &nbsp;

<a href = "pract-3.2.html">Jaguar</a>&nbsp; || &nbsp;

<a href = "pract-3.3.html">Ferrari</a>&nbsp; || &nbsp;

<font face = "Segoe Print">

<h5>

<ul>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.3 ROLL NO.25

<li>Jaguar Cars is a brand of cars made by Jaguar Land Rover. It was renamed Jaguar in
1935. </li>

<li>This is a British car builder, owned by the Indian builder Cans Tata Motors since the
beginning of 2008.[3] It was established in 1922 by William Lyons. </li>

<li>Jaguar is owned by the Indian automobile manufacturer Tata Motors Ltd. Jaguar is
known for its luxury sedans and sportscars.</li>

</h5>

</font>

</ul>

</body>

</html>

Output :

For page 3:

Code :

<html>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.3 ROLL NO.25

<head>

<title>pract-3.3</title>

</head>

<body background = "3.jpg">

<h2><center>

<a href = "pract-3.1.html">Mercedez</a>&nbsp; || &nbsp;

<a href = "pract-3.2.html">Jaguar</a>&nbsp; || &nbsp;

<a href = "pract-3.3.html">Ferrari</a>&nbsp; || &nbsp;

<font face = "Segoe Print">

<h5>

<ul>

<li>Ferrari (/fəˈrɑːri/; Italian: [ferˈraːri]) is an Italian luxury sports car manufacturer based
in Maranello, Italy. </li>

<li>Founded by Enzo Ferrari in 1939 out of the Alfa Romeo race division as Auto Avio
Costruzioni, the company built its first car in 1940. </li>

<li>However, the company's inception as an auto manufacturer is usually recognized as


1947, when the first Ferrari-badged car was completed.</li>

</h5>

</font>

</ul>

</body>

</html>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.3 ROLL NO.25

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.4 ROLL NO.25

Aim : Design a web page with Image and Imagemaps.

Code :

<html>

<head>

<title>Pract-4</title>

</head>

<body>

<img src ="C:\Users\soham\Desktop\BCA 3RD SEM NOTES\HTML Codes\7.jpg" alt =


"no flower" usemap = "#test">

<map name = "test">

<area shape = "poly" coords = "209,273,124,332,297,332,157,429,264,428" alt = "no poly"


href = "pract-3.1.html">

<area shape = "rect" coords = "93,102,354,214" alt = "no rect" href = "pract-3.2.html">

</body>

</html>

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.4 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.4 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.5 ROLL NO.25

Aim : Create a student table with the following fields. Student Id, Name, DOB, Course,
Address, E-mail id and apply Embedded cascading style sheet CSS with the following
attributes: Font size, color, style, bold, italic, border color, set the background image & set the
center align of table & text.

Code :

<html>

<head>

<title>Pract-5</title>

<style type = "text/Css">

td{ text-

align:center;

color:green; font-

style:bold; font

size:20px;

table{ color:blue;

bordercolor:red; background-image:

url("image.jpg"); height:500px;

width:700px;

th{

font-size:25px;

color:purple;

</style>

</head>

<body>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.5 ROLL NO.25

<table border = "2" bordercolor = "blue" bgcolor = "yellow" cellspacing = "4" cellpadding
= "5">

<caption>Student Details</caption>

<tr>

<th>Sid</th>

<th>Name</th>

<th>DOB</th>

<th>ADDRESS</th>

<th>E-ID</th>

</tr>

<tr>

<td>1</td>

<td>Sonali</td>

<td>2/3/2001</td>

<td>Goregaon</td>

<td>sonali12@gmail.com</td>

</tr>

<tr>

<td>2</td>

<td>Pranali</td>

<td>2/4/2000</td>

<td>Malad</td>

<td>pranaliyd$@gmail.com</td>

</tr>

<tr>

<td>3</td>

<td>Shreya</td>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.5 ROLL NO.25

<td>26/11/1998</td>

<td>Nagpur</td>

<td>shreya2345#@gmail.com</td>

</tr>

<tr>

<td>4</td>

<td>Rohan</td>

<td>13/6/1999</td>

<td>Navi Mumbai</td>

<td>rohan#urt@gmail.com</td>

</tr>

<tr>

<td>5</td>

<td>Max</td>

<td>6/2/2002</td>

<td>Pune</td>

<td>maxcvb3@gmail.com</td>

</tr>

</table> </body>

</html>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.5 ROLL NO.25

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.6 ROLL NO.25

Aim : Create an external CSS for above and apply to the web page.

Code :

For HTML :

<html>

<head>

<title>pract-6-html</title>

<link rel = "stylesheet" type = "text/css" a href = "pract-6-css.html">

</head>

<body>

<table border = "2" bordercolor = "blue" bgcolor = "yellow" cellspacing = "4" cellpadding
= "5">

<caption>Student Details</caption>

<tr>

<th>Sid</th>

<th>Name</th>

<th>DOB</th>

<th>ADDRESS</th>

<th>E-ID</th>

</tr>

<tr>

<td>1</td>

<td>Sonali</td>

<td>2/3/2001</td>

<td>Goregaon</td>

<td>sonali12@gmail.com</td>

</tr>

<tr>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.6 ROLL NO.25

<td>2</td>

<td>Pranali</td>

<td>2/4/2000</td>

<td>Malad</td>

<td>pranaliyd$@gmail.com</td>

</tr>

<tr>

<td>3</td>

<td>Shreya</td>

<td>26/11/1998</td>

<td>Nagpur</td>

<td>shreya2345#@gmail.com</td>

</tr>

<tr>

<td>4</td>

<td>Rohan</td>

<td>13/6/1999</td>

<td>Navi Mumbai</td>

<td>rohan#urt@gmail.com</td>

</tr>

<tr>

<td>5</td>

<td>Max</td>

<td>6/2/2002</td>

<td>Pune</td>

<td>maxcvb3@gmail.com</td>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.6 ROLL NO.25

</tr>

</table> </body>

</html>

For CSS :

Code :

<html>

<head>

<title>Pract-6-css</title>

<style type = "text/Css">

td{ text-

align:center;

color:green; font-

style:bold; font

size:20px;

table{ color:blue;

bordercolor:red; background-

image: url("f-1.jpg");

height:500px; width:700px;

th{

font-size:25px;

color:purple;

</style>

</head>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.6 ROLL NO.25

</html>

Output :

WEB TECHNOLOGY
SYBCA ROLL NO.25
PRACTICAL NO.7

Aim : Create a frameset that divides browser window into horizontal and vertical framesets

Code :

<html>

<head>

<title>Pract-7</title>

</head>

<frameset rows = "35%,20%,*">

<frameset cols = "50%,*">

<frame name = 1>

<frame name = 2>

</frameset>

<frame name = 3>

<frameset cols = "25%,40%,*">

<frame name = 4>

<frameset rows = "50%,*">

<frame name = 5>

<frame name = 6>

</frameset>

<frame name = 7>

</frameset>

</frameset>

</html>

WEB TECHNOLOGY
SYBCA ROLL NO.25

PRACTICAL NO.7

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.8 ROLL NO.25
Aim : Write the javascript code to enter five numbers in the prompt box. Calculate addition of
the numbers & average.

Code :

<html>

<head>

<title>Pract-8</title>

</head>

<body>

<script type = "text/javascript">

var U,V,W,X,Y; var a =

prompt("Enter eng no."); U=

parseInt(a); var b = prompt("Enter

math no."); V = parseInt(b);

var c = prompt("Enter IT no.");

W = parseInt(c);

var d = prompt("Enter Sci no.");

X = parseInt(d); var e =

prompt("Enter CS no"); Y=

parseInt(e);

var i = U+V+W+X+Y;

document.write("Total is : " + i);

document.write("<br />"); var j =

i/500*100; document.write("% is : " + j

+ "%"); document.write("<br />");

WEB TECHNOLOGY
SYBCA PRACTICAL NO.8 ROLL NO.25

</script>

</body>

</html>

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.8 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.8 ROLL NO.25

WEB TECHNOLOGY
SYBCA ROLL NO.25
PRACTICAL NO.9

Aim : Create a web page with image and text apply javascript Mouse events – onmouseover ,
onmouseout, onclick on the image and text.

Code :

<html>

<head>

<title>Pract-9</title>

</head>

<body>

<h1 onmouseover = "style.color = 'red' " onmouseout = "style.color = 'pink' ">Mouse


over this text</h1>

<p onmouseover = "style.opacity = '0.3' " onmouseout = "style.opacity = '1' ">

<img src = "C:\Users\soham\Desktop\BCA 3RD SEM NOTES\web tech practicals\2.jpg"


height = "50%" width = "50%"></p>

</body>

</html>

Output :

PRACTICAL NO.9

WEB TECHNOLOGY
SYBCA ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.10 ROLL NO.25
Aim : Create a page which displays Javascript pop-up-boxes :

1. Alert

2. Confirm

3. Prompt.

Code :

For Alert Box :

Code :

<html>

<head>

<title>Pract-10-1</title>

<script type = "text/javascript">

<!--

function Warn()

{ alert("This is a warning

message! "); document.write("This is a warning

message!");

//-->

</script>

</head>

<body>

<form>

<input type = "button" onclick = "Warn();" value = "Click Me" />

</form>

</body>

</html>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.10 ROLL NO.25

Output :

For Confirm Box :

Code :

<html>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.10 ROLL NO.25

<head>

<title>Pract-10-2</title>

<script>

<!--

function getConfirmation()

var retVal = confirm("Do not want to continue ?"); if(retVal

== true)

{ document.write("User wants to continue!");

return true; } else {

document.write("User does not want to continue! ");

return false;

//-->

</script>

</head>

<body>

<p>Click the following button to see the result: </p>

<form>

<input type = "button" value = "Click Me" onclick = "getConfirmation()" />

</form>

</body>

</html>

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.10 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.10 ROLL NO.25

For Prompt Box :

Code :

<html>

<head>

<title>Pract-10-3</title>

</head>

<body>

<h2>Javascript Prompt Box</h2>

<button onclick = "myFunction()">Try it</button>

<p id = "demo"></p>

<script>

function myFunction()

var txt;

var person = prompt("Please enter your name: ", "Harry Potter");

if(person == null || person == " ")

WEB TECHNOLOGY
SYBCA PRACTICAL NO.10 ROLL NO.25

txt = "User cancelled the prompt !";

else

txt = "Hello "+ person + "! How are you today?";

document.getElementById("demo").innerHTML = txt;

</script>

</body>

</html>

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.10 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.11 ROLL NO.25

Aim : Design a form and validate all the controls placed on the form using Java Script.

Code :

<html>

<head>

<title>Pract-11</title>

<script type = "text/javascript">

<!-- function

validate()

if(document.myForm.Name.value == "" || document.myForm.Name.value ==


null)

alert("Please provide your name!");

document.myForm.Name.focus(); return

false;

if(document.myForm.EMail.value == " ")

alert("Please provide your EMail!");

document.myForm.EMail.focus(); return

false;

if(document.myForm.Zip.value == " " || isNaN (document.myForm.Zip.value) ||


document.myForm.Zip.value.length != 5)

alert("Please provide a Zip in the format ##### .");

document.myForm.Zip.focus(); return false;

WEB TECHNOLOGY
SYBCA PRACTICAL NO.11 ROLL NO.25

if(document.myForm.Country.value == "-1")

alert("Please provide your country!");

return false;

return(true);

//-->

</script>

</head>

<body>

<form action = "p-11.html" name = "myForm" onsubmit = "return(validate());">

<table cellspacing = "2" cell padding = "2" border = "1">

<tr>

<td align = "right">Name</td>

<td><input type = "text" name = "Name" /></td>

</tr>

<tr>

<td align = "right">EMail</td>

<td><input type = "text" name = "EMail" /></td>

</tr>

<tr>

<td align = "right">Zip</td>

<td><input type = "text" name = "Zip" /></td>

</tr>

<tr>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.11 ROLL NO.25

<td align = "right">Country</td>

<td>

<select name = "Country">

<option value = "-1" selected>[choose yours]</option>

<option value = "1">USA</option>

<option value = "2">UK</option>

<option value = "3">INDIA</option>

</select>

</td>

</tr>

<tr>

<td align = "right"></td>

<td><input type = "Submit" value = "Submit" /></td>

</tr>

</table>

</form>

</body>

</html>

p-11.html :

Code:

<html>

<head>

<title>P-11</title>

</head>

<body>

<p>Form Submitted Successfully.!!!</p>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.11 ROLL NO.25

</body>

</html>

Output :

WEB TECHNOLOGY
SYBCA PRACTICAL NO.11 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.11 ROLL NO.25

WEB TECHNOLOGY
SYBCA PRACTICAL NO.12 ROLL NO.25

Aim: Design a DTD, corresponding XML document and display it in browser using CSS.

Code:

CSS file: order.css

th { background-

color:pink;

} td { backgroung-

color:yellow; text-

align:center; font-

family:Comic sns ms; font-

weight:bold;

font-style:italic; color:blue;

h2 {

color:red;

DTD file: order-dtd.dtd

<?xml version = "1.0" encoding = "UTF

<?xml-stylesheet type = "text/xsl" href = "order-xsl.xsl"?>

<!DOCTYPE order

WEB TECHNOLOGY
SYBCA PRACTICAL NO.12 ROLL NO.25

-8"?>
<!ELEMENT order (customer,product)>

<!ELEMENT customer (name,address,contact)>

<!ELEMENT name (#PC DATA)>

<!ELEMENT address (#PC DATA)>

<!ELEMENT contact (email,tel_no)>

<!ELEMENT email (#PC DATA)>

<!ELEMENT tel_no (#PC DATA)>

<!ELEMENT product (name_p,price,quantity)>

<!ELEMENT name_p (#PC DATA)>

<!ELEMENT price (#PC DATA)>

<!ELEMENT quantity (#PC DATA)>

]>

XML file: order-xml.xml

<?xml version = "1.0" encoding = "UTF

<?xml-stylesheet type = "text/xsl" href = "order-xsl.xsl"?>

<order>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.12 ROLL NO.25

-8"?>
<customer>

<name>Keny</name>

<address>Mumbai</address>

<contact>

<email>keny2345@gmail.com</email>

<tel_no>011-12345678</tel_no>

</contact>

</customer>

<product>

<name_p>Paper</name_p>

<price>40.00</price>

<quantity>10</quantity>

</product>

</order>

XSL file: order-xsl.xsl

WEB TECHNOLOGY
SYBCA PRACTICAL NO.12 ROLL NO.25

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

version = "1.0" xmlns:xsl =

"http://www.w3.org/1999/XSL/Transform">

<xsl:template match = "/">

<html>

<head>

<link rel = "stylesheet" type = "text/css" href = "order.css" />

</head>

<body>

<table border = "1" align = "center">

<caption><h2>ORDER DETAILS</h2></caption>

<tr>

<th>Customer name:</th>

<td><xsl:value-of select = "order/customer/name" /></td><br />

</tr>

<tr>

<th>Address:</th>

<td><xsl:value-of select = "order/customer/address" /></td><br />

</tr>

<tr>

<th>Contact:</th>

<td><xsl:value-of select = "order/customer/contact" /></td><br />

WEB TECHNOLOGY
SYBCA PRACTICAL NO.12 ROLL NO.25

-8"?>
</tr>

<tr>

<th>Product name:</th>

<td><xsl:value-of select = "order/product/name_p" /></td><br />

WEB TECHNOLOGY
SYBCA PRACTICAL NO.12 ROLL NO.25

</tr>

<tr>

<th>Price:</th>

<td><xsl:value-of select = "order/product/price" /></td><br />

</tr>

<tr>

<th>Quantity:</th>

<td><xsl:value-of select = "order/product/quantity" /></td><br />

</tr>

</table>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.13 ROLL NO.25

OUTPUT:

WEB TECHNOLOGY
SYBCA PRACTICAL NO.12 ROLL NO.25

Aim: Design an XML document and display it in browser using XSL.

Code:

Order-xml.xml:

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

<?xml-stylesheet type = "text/xsl" href = "order-xsl.xsl"?>

<order>

<customer>

<name>Keny</name>

<address>Mumbai</address>

<contact>

<email>keny2345@gmail.com</email>

<tel_no>011-12345678</tel_no>

</contact>

</customer>

<product>

<name_p>Paper</name_p>

<price>40.00</price>

<quantity>10</quantity>

</product>

</order>

Order-xsl.xsl:

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

<xsl:stylesheet version = "1.0" xmlns:xsl =

"http://www.w3.org/1999/XSL/Transform">

<xsl:template match = "/">

WEB TECHNOLOGY
SYBCA PRACTICAL NO.13 ROLL NO.25

<html>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.13 ROLL NO.25

<head>

</head>

<body>

<table border = "1" align = "center">

<caption><h2>ORDER DETAILS</h2></caption>

<tr>

<th>Customer name:</th>

<td><xsl:value-of select = "order/customer/name" /></td><br />

</tr>

<tr>

<th>Address:</th>

<td><xsl:value-of select = "order/customer/address" /></td><br />

</tr>

<tr>

<th>Contact:</th>

<td><xsl:value-of select = "order/customer/contact" /></td><br />

</tr>

<tr>

<th>Product name:</th>

<td><xsl:value-of select = "order/product/name_p" /></td><br />

</tr>

<tr>

<th>Price:</th>

<td><xsl:value-of select = "order/product/price" /></td><br />

</tr>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.13 ROLL NO.25

<tr>

<th>Quantity:</th>

<td><xsl:value-of select = "order/product/quantity" /></td><br />

</tr>

</table>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

Order.dtd:

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

<?xml-stylesheet type = "text/xsl" href = "order-xsl.xsl"?>

<!DOCTYPE order

<!ELEMENT order (customer,product)>

<!ELEMENT customer (name,address,contact)>

<!ELEMENT name (#PCDATA)>

<!ELEMENT address (#PCDATA)>

<!ELEMENT contact (email,tel_no)>

<!ELEMENT email (#PCDATA)>

<!ELEMENT tel_no (#PCDATA)>

<!ELEMENT product (name_p,price,quantity)>

<!ELEMENT name_p (#PCDATA)>

<!ELEMENT price (#PCDATA)>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.13 ROLL NO.25

<!ELEMENT quantity (#PCDATA)>

]>

Output:

WEB TECHNOLOGY
SYBCA PRACTICAL NO.14 ROLL NO.25

Aim: Design XML Schema and corresponding XML document.

Code:

Shiporder-xml.xml:

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

orderid = "889923" xmlns:xsi =

"https://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation = "shiporder.xsd">

<orderperson>John Smith</orderperson>

<shipto>

<name>Ola Nordamnn</name>

<address>Langgt 23</address>

<city>4000 Stavanger</city>

<country>Norway</country>

</shipto>

<item>

<title>Empire Burlesque</title>

<note>Special Edition</note>

<quantity>1</quantity>

<price>10.90</price>

</item>

<item>

<title>Hide your heart</title>

<quantity>1</quantity>

<price>9.90</price>

</item>

</shiporder>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.14 ROLL NO.25

Shiporder-xsl.xsl:

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

<xs:schema xmlns:xs = "https://www.w3.org/2001/XMLSchema">

<xs:element name = "shiporder">

<xs:complexType>

<xs:sequence>

<xs:element name = "orderperson" type = "xs:string"/>

<xs:element name = "shipto">

<xs:complexType>

<xs:sequence>

<xs:element name = "name" type = "xs:string"/>

<xs:element name = "address" type = "xs:string"/>

<xs:element name = "city" type = "xs:string"/>

<xs:element name = "country" type = "xs:string"/>

</xs:sequence>

</xs:complexType>

<xs:element>

<xs:element name = "item" maxOccurs = "unbounded">

<xs:complexType>

<xs:sequence>

<xs:element name = "title" type = "xs:string"/>

<xs:element name = "note" type = "xs:string" minOccurs = "0"/>

<xs:element name = "quantity" type = "xs:positiveInteger"/>

<xs:element name = "price" type = "xs:decimal"/>

</xs:sequence>

WEB TECHNOLOGY
SYBCA PRACTICAL NO.14 ROLL NO.25

</xs:complexType>

</xs:element>

</xs:element>

</xs:sequence>

<xs:attribute name = "orderid" type = "xs:string" use = "required"/>

</xs:complexType>

</xs:element>

</xs:schema>

Output:

WEB TECHNOLOGY

You might also like