HA Image

You might also like

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

JFSD HOME ASSIGNMENT

NAME: PERI VISHWANADHA SASTRY ROLL NO: 2010030470

1. Hermione wants to know more about XML before attending classes.


So, she visited professors and each of them gave her some questions
regarding XML.

a. As Hermione requested Professor Trelawney gave her a task to check


the OWL test papers. He asked her to check the XML written by a
student in Owl's test and correct it according to XML syntax rules to
help her out in doing this task
<?xml version=" 1.0" encoding="UTF-8">
<Diary>
<Monday>
<Monday date="3I"July""year= 1994/>
<name>Harry Potter</name>
<Heading>My birthday</heading>
<body>Aunt Marge spoiled my day. <body><!-My- notes -->
</Diary>
</Monday>
Ans: <?xml version="1.0" encoding="UTF-8"?>
<Diary>
<Monday date="31 July" year= "1994">
<name>Harry Potter</name>
<Heading>My birthday</Heading>
<body>Aunt Marge spoiled my day. </body><!-- My Notes --
>
</Monday>
</Diary>
b. Then Hermione went to Professor Rubeus Hagrid who gives his
utmost care to his magical creatures. As We cannot predict the weather
in Hogwarts, she was asked to Create a well-formed XML for reporting
weather forecasts in the wizarding world from Monday to Saturday for
Professor Rubeus Hagrid to provide sheller for Ills magical creatures.
Write the place, date, report, and add an internal dtd to validate the
elements.
Ans:
Forecast.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE forcast SYSTEM "Forecast.dtd">
<forcast>
<place>Hyderabad</place>
<date>27, July, 2022</date>
<report>Inhalable pollutant particles with a diameter less
than 10 micrometers.
Particles that are larger than 2.5 micrometers can be
deposited in airways, resulting in health issues.
Exposure can result in eye and throat irritation, coughing
or difficulty breathing, and aggravated asthma. </report>
</forcast>
Forecast.dtd
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT forcast (place,date,report)>
<!ELEMENT place (#PCDATA)>
<!ELEMENT date (#PCDATA)>
<!ELEMENT report (#PCDATA)>

Output:
c. She is much more excited after completing the task given by
Professor Trelawney. Then she visited A wizarding bank that wants to
store some data regarding wizards and goblins. Hogwarts is a place
where almost every person knows everything the wizarding bank staff
came to know that Hermione is studying XML, so they requested her to
Create a well-formed XML for displaying the details of the wizards and
goblins of the bank and provide some additional information about the
details like gender, address, etc., and link to the CSS stylesheet.
Ans:
Wizarding.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/css" href="Wizarding.css"?>
<body>
<table>
<colgroup>
<col id='S.No' />
<col id='Name' />
<col id='Category' />
<col id='Gender' />
<col id='Address' />
</colgroup>
<thead>
<tr>
<th>S.No</th>
<th>Name</th>
<th>Category</th>
<th>Gender</th>
<th>Address</th>
</tr>
</thead>
<tbody>
<tr>
<td>01</td>
<td>Harry Potter</td>
<td>Wizard</td>
<td>Male</td>
<td>London</td>
</tr>
<tr>
<td>02</td>
<td>Ron</td>
<td>Wizard</td>
<td>Male</td>
<td>Greenwich</td>
</tr>
<tr>
<td>03</td>
<td>Dobby</td>
<td>Goblin</td>
<td>Male</td>
<td>Hogwarts</td>
</tr>
<tr>
<td>04</td>
<td>Gringott</td>
<td>Goblin</td>
<td>Male</td>
<td>Hogwarts</td>
</tr>
</tbody>
</table>
</body>

Wizarding.css
body {
display: block;
margin: 15px;
}
table {
display: table;
width: 500px;
caption-side: bottom;
border: thin solid black;
table-layout: fixed;
border-spacing: 0;
}
colgroup {
display: table-column-group;
}
col {
display: table-column;
}
thead {
display: table-header-group;
}
tbody {
display: table-row-group;
}
tr {
display: table-row;
}
th, td {
display: table-cell;
border: thin solid black;
text-align: center;
font-weight: bold;
overflow: hidden;
}
th {
background: lightgrey;
}
td {
vertical-align: top;
}
caption {
display: table-caption;
font-size: 90%;
text-align: right;
}
td, th, caption {
padding: 5px;
}

Output:

You might also like