0% found this document useful (0 votes)
25 views62 pages

Updated XML PRACTICAL LIST With Manual w-24

The document outlines a series of XML programming practicals for BCA III Semester students, detailing tasks such as creating well-formed XML documents for various data types including cars, students, books, and food items. Each task includes specific requirements for data structure and the use of XSLT for displaying the data in a tabular format. Additionally, it covers the creation of XML documents with validation using XML Schema and DTD.

Uploaded by

millidomestic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views62 pages

Updated XML PRACTICAL LIST With Manual w-24

The document outlines a series of XML programming practicals for BCA III Semester students, detailing tasks such as creating well-formed XML documents for various data types including cars, students, books, and food items. Each task includes specific requirements for data structure and the use of XSLT for displaying the data in a tabular format. Additionally, it covers the creation of XML documents with validation using XML Schema and DTD.

Uploaded by

millidomestic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 62

G H RAISONI COLLEGE OF ENGINEERING AND MANAGEMENT

Subject Name: XML


PROGRAMMING Subject Code:
BCL504
Semester: BCA III SEM 5TH YEAR
List of XML programming Practical’s
Sr. No Name of Program
1 Create a well-formed XML document containing details of a car like: id,
company name, model, engine and mileage.
2 Create a well-formed XML document to show following tree structure of
student information:

3 Create a XML document which contains details of cars car like: id, company
name, model, engine and mileage and display the same as a table by using
<xsl:for-each> element by using XSLT.
4 Create a XML document Which contains details of book store information like:
Book ID, Book, Name Author, Name, Publisher, Price and Edition and display
the same as a table by using <xsl:value-of> element by using XSLT.
5 Create a XML document Which contains details of foodtype information like:
Name, carbs_per_serving, fiber_per_serving, fat_per_serving, kj_per_serving
and display the same as a table by using xsl:if element by using XSLT.
6 Create a XML document Which contains details of Student information like:
Rollno, firstname,, lastname, nickname, marks and display the same as a
table by using xsl:sort element by using XSLT.
7 Create a XML document Which contains details of Employee information like:
empid, firstname,, lastname, designation, salary and display the same as a table
by using xsl:choose element by using XSLT.
8 Create a XML document Which contains details of Employee information like:
empid, firstname,, lastname, designation, salary and display the same as a table
by using xsl:apply-templates element by using XSLT.
9 Create a XML document Which contains details of Bank information like:
customer id, customername, accountnumber , accounttype , bankname
branchname IFSCcode Address and display the same as a table by using
xsl:import element by using XSLT.
10 Create a XML document Which contains details of matrimony registration
information like:
id, firstname,, lastname, DOB,
Height,complexion,Education,job_description,address,mobile no and display
the same as a table by using xsl:key element by using XSLT.
11 Create a valid XML document containing details of a car like: id, company
name, model, engine and mileage by using XML Schema.
12 Create a valid Internal DTD document containing details of a car like: id,
company name, model, engine and mileage using DTD validate with php file.
13 Create a valid DTD document for Newspaper Article by using
Element,Attribute and Entity building blocks validate with php file.

14 Create a XML document to parse an XML string into an XML DOM object and
then extract the information of important note.

15 Create a valid XML document of train information like:train title,train type


,name, number, source and destination by using DTD and CSS.

16 Create a valid xml document to encode TV Program Schedules by using


External DTD validate with php file.

17 Write a program to create a valid XML document for A simple address book to
store the following information: The person name, Home address,
state,pincode, Telephone number, FAX number, Mobile number E-mail address
by using XML schema.
18 Create a valid xml document to show the information about subject topics by
using css
PROGRAM NO1:

Create a well-formed XML document containing details of a car like: id, company name, model,
engine and mileage.
car.xml
<?xml version="1.0" encoding="UTF-8"?>
<cars>
<car id="c101">
<company>Maruthi</company>
<model>Swift</model>
<engine>1248cc</engine>
<mileage>20</mileage>
</car>
<car id="c102">
<company>Hyundai</company>
<model>i20</model>
<engine>1000cc</engine>
<mileage>15</mileage>
</car>
<car id="c103">
<company>Honda</company>
<model>kia</model>
<engine>1200cc</engine>
<mileage>20</mileage>
</car>
</cars>
output:

PROGRAM NO 2:

Create a well-formed XML document to show following tree structure of student


information:

student.xml:
<?xml version="1.0" encoding="utf-8"?>
<college>
<student>
<firstname>Tamanna</firstname>
<lastname>Bhatia</lastname>
<contact>09990449935</contact>
<email>[email protected]</email>
<address>
<city>Ghaziabad</city>
<state>Uttar Pradesh</state>
<pin>201007</pin>
</address>
</student>
<student>
<firstname>Radhika </firstname>
<lastname>Batra</lastname>
<contact>09876456777</contact>
<email>[email protected]</email>
<address>
<city>nagpur</city>
<state>Maharatra</state>
<pin>440001</pin>
</address>
</student>
<student>
<firstname>Aditya</firstname>
<lastname>Bhandari</lastname>
<contact>09990449945</contact>
<email>[email protected]</email>
<address>
<city>Aurangabad</city>
<state>Maharatra</state>
<pin>431001</pin>
</address>
</student>
<student>
<firstname>Rahul</firstname>
<lastname>Vaidya</lastname>
<contact>09890445936</contact>
<email>[email protected]</email>
<address>
<city>Jalgaon</city>
<state>Maharastra</state>
<pin>412005</pin>
</address>
</student>
<student>
<firstname>Ram</firstname>
<lastname>Sharma</lastname>
<contact>09490645937</contact>
<email>[email protected]</email>
<address>
<city>nagpur</city>
<state>Mararastra</state>
<pin>440001</pin>
</address>
</student>
<student>
<firstname>shyam</firstname>
<lastname>Thakur</lastname>
<contact>09960449945</contact>
<email>[email protected]</email>
<address>
<city>Ghaziabad</city>
<state>Uttar Pradesh</state>
<pin>201008</pin>
</address>
</student>
</college>
PROGRAM NO 3

Create a XML document which contains details of cars car like: id, company name, model, engine
and mileage and display the same as a table by using <xsl:for-each> element by using XSLT.

maruti.xml

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


<?xml-stylesheet type="text/xsl" href="ex4.xsl"?>
<cars>
<car id="c101">
<company>Maruthi</company>
<model>Swift</model>
<engine>1248cc</engine>
<mileage>20</mileage>
</car>
<car id="c102">
<company>Hyundai</company>
<model>i20</model>
<engine>1000cc</engine>
<mileage>15</mileage>
</car>
</cars>

ex4.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
xmlns = "http://www.w3.org/1999/xhtml">
<xsl:template match="cars">
<html>
<body>
<h1>Car Details</h1>
<table border="1" cellpadding="10">
<tr>
<th>Company Name</th>
<th>Model Name</th>
<th>Engine</th>
<th>Mileage</th>
</tr>
<xsl:for-each select="car">
<tr>
<td><xsl:value-of select="company" /></td>
<td><xsl:value-of select="model" /></td>
<td><xsl:value-of select="engine" /></td>
<td><xsl:value-of select="mileage" /> km</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

OUTPUT:
PROGRAM NO 4
Create a XML document Which contains details of book store information like:
Book ID, Book, Name Author, Name, Publisher, Price and Edition and display the same as a table
by using <xsl:value-of> element by using XSLT.

Books.xml:

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


<?xml-stylesheet type="text/xsl" href="Books.xsl"?>
<store> <!-- Root Element -->
<book id ="5350192956">
<bookname>XSLT Programmer's Reference</bookname>
<authorname>Michael Kay</authorname>
<publisher>Wrox</publisher>
<price>$40</price>
<edition>4th</edition>
</book>
<book id ="3741122298">
<bookname>Head First Java</bookname>
<authorname>Kathy Sierra</authorname>
<publisher>O'reilly</publisher>
<price>$19</price>
<edition>1st</edition>
</book>
<book id ="9987436700">
<bookname>SQL The Complete Reference</bookname>
<authorname>James R. Groff</authorname>
<publisher>McGraw-Hill</publisher>
<price>$45</price>
<edition>3rd</edition>
</book>
</store>

Books.xsl:

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


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match = "/">
<html>
<body>
<h2>Books:-</h2>
<table border = "1">
<tr bgcolor = "#cd8932">

<th>Book ID</th>
<th>Book Name</th>
<th>Author Name</th>
<th>Publisher</th>
<th>Price</th>
<th>Edition</th>
</tr>
<xsl:for-each select="store/book">

<tr bgcolor = "#84cd32">


<td><xsl:value-of select = "@id"/></td>
<td><xsl:value-of select = "bookname"/></td>
<td><xsl:value-of select = "authorname"/></td>
<td><xsl:value-of select = "publisher"/></td>
<td><xsl:value-of select = "price"/></td>
<td><xsl:value-of select = "edition"/></td>
</tr>

</xsl:for-each>

</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT:

PROGRAM NO 5
Create a XML document Which contains details of foodtype information like:
Name, carbs_per_serving, fiber_per_serving, fat_per_serving, kj_per_serving and display
the same as a table by using xsl:if element by using XSLT.

menu1.xml:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="menu.xsl"?>
<food_list>
<food_item type="vegetable">
<name>Cabbage</name>
<carbs_per_serving>0</carbs_per_serving>
<fiber_per_serving>1</fiber_per_serving>
<fat_per_serving>0</fat_per_serving>
<kj_per_serving>14</kj_per_serving>
</food_item>
<food_item type="vegetable">
<name>Potato</name>
<carbs_per_serving>21.5</carbs_per_serving>
<fiber_per_serving>2</fiber_per_serving>
<fat_per_serving>1</fat_per_serving>
<kj_per_serving>460</kj_per_serving>
</food_item>
<food_item type="vegetable">
<name>Pumpkin</name>
<carbs_per_serving>6</carbs_per_serving>
<fiber_per_serving>1</fiber_per_serving>
<fat_per_serving>0.5</fat_per_serving>
<kj_per_serving>150</kj_per_serving>
</food_item>
<food_item type="vegetable">
<name>Yam</name>
<carbs_per_serving>30.5</carbs_per_serving>
<fiber_per_serving>2</fiber_per_serving>
<fat_per_serving>0.5</fat_per_serving>
<kj_per_serving>550</kj_per_serving>
</food_item>

<food_item type="vegetable">
<name>Zucchini</name>
<carbs_per_serving>1.5</carbs_per_serving>
<fiber_per_serving>1.5</fiber_per_serving>
<fat_per_serving>0.5</fat_per_serving>
<kj_per_serving>55</kj_per_serving>
</food_item>
<food_item type="seafood">
<name>Abalone</name>
<carbs_per_serving>0</carbs_per_serving>
<fiber_per_serving>0</fiber_per_serving>
<fat_per_serving>1</fat_per_serving>
<kj_per_serving>400</kj_per_serving>
</food_item>
<food_item type="seafood">
<name>Barramundi</name>
<carbs_per_serving>0</carbs_per_serving>
<fiber_per_serving>0</fiber_per_serving>
<fat_per_serving>2</fat_per_serving>
kj_per_serving>390</kj_per_serving>
</food_item>
<food_item type="fruit">
<name>Apple</name>
<carbs_per_serving>15</carbs_per_serving>
<fiber_per_serving>2.5</fiber_per_serving>
<fat_per_serving>0</fat_per_serving>
<kj_per_serving>250</kj_per_serving>
</food_item>
<food_item type="fruit">
<name>Kiwi Fruit</name>
<carbs_per_serving>7.5</carbs_per_serving>
<fiber_per_serving>2.5</fiber_per_serving>
<fat_per_serving>0</fat_per_serving>
<kj_per_serving>150</kj_per_serving>
</food_item>
<food_item type="grain">
<name>Oatbran</name>
<carbs_per_serving>62</carbs_per_serving>
<fiber_per_serving>14</fiber_per_serving>
<fat_per_serving>7</fat_per_serving>
<kj_per_serving>1400</kj_per_serving>
</food_item>
<food_item type="grain">
<name>Wheatgrain</name>
<carbs_per_serving>1.5</carbs_per_serving>
<fiber_per_serving>1</fiber_per_serving>
<fat_per_serving>0.5</fat_per_serving>
<kj_per_serving>70</kj_per_serving>
</food_item>
</food_list>

menu.xsl

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="food_list">
<table>
<tr style="background-color:#ccff00">
<th>Food Item</th>
<th>Carbs (g)</th>
<th>Fiber (g)</th>
<th>Fat (g)</th>
<th>Energy (kj)</th>
</tr>
<xsl:for-each select="food_item">
<xsl:if test="@type = 'vegetable'">
<tr style="background-color:#00cc00">
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="carbs_per_serving"/></td>
<td><xsl:value-of select="fiber_per_serving"/></td>
<td><xsl:value-of select="fat_per_serving"/></td>
<td><xsl:value-of select="kj_per_serving"/></td>

</tr>
</xsl:if>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
OUTPUT:

BEFORE IF CONDITION:

AFTER IF CONDITION:
PROGRAM NO 6
Create a XML document Which contains details of Student information like:
Rollno, firstname,, lastname, nickname, marks and display the same as a table by using xsl:sort
element by using XSLT.

sort.xml:
<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "sort.xsl"?>
<class>
<student rollno = "393">
<firstname>Dinkar</firstname>
<lastname>Kad</lastname>
<nickname>Dinkar</nickname>
<marks>85</marks>
</student>
<student rollno = "493">
<firstname>Vaneet</firstname>
<lastname>Gupta</lastname>
<nickname>Vinni</nickname>
<marks>95</marks>
</student>
<student rollno = "593">
<firstname>Jasvir</firstname>
<lastname>Singh</lastname>
<nickname>Jazz</nickname>
<marks>90</marks>
</student>
</class>

sort.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 = "/">
<html>
<body>
<h2>Students</h2>
<table border = "1">
<tr bgcolor = "#9acd32">
<th>Roll No</th>
<th>First Name</th>
<th>Last Name</th>
<th>Nick Name</th>
<th>Marks</th>
</tr>

<xsl:for-each select = "class/student">

<xsl:sort select = "lastname"/>


<tr>
<td><xsl:value-of select = "@rollno"/></td>
<td><xsl:value-of select = "firstname"/></td>
<td><xsl:value-of select = "lastname"/></td>
<td><xsl:value-of select = "nickname"/></td>
<td><xsl:value-of select = "marks"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT:

Before sort:

After sort:
PROGRAM NO 7
Create a XML document Which contains details of Patient information like:
patient ID, patient name, gender, address , birth date, mobile no, blood group, disease type and BP
display the same as a table by using xsl:choose element by using XSLT.

patient.xml:

<?xml version = "1.0"?>


<?xml-stylesheet type = "text/xsl" href = "patient.xsl"?>
<patientdetail>
<patient ID= "393">
<patientname>Dinkar khad</patientname>
<gender>male</gender>
<address>mahal,nagpur</address>
<birthdate>24/05/1984</birthdate>
<mobile_no>9875632356</mobile_no>
<blood_group>A +ve</blood_group>
<disease_type>viral fever</disease_type>
<BP>120</BP>
</patient>
<patient ID= "394">
<patientname>Sonali gharade</patientname>
<gender>female</gender>
<address>jaripataka,nagpur</address>
<birthdate>20/09/1967</birthdate>
<mobile_no>9075632396</mobile_no>
<blood_group>B +ve</blood_group>
<disease_type>Hypotension</disease_type>
<BP>90</BP>
</patient>
<patient ID= "395">
<patientname>Rahul vaidya</patientname>
<gender>male</gender>
<address>sadar,nagpur</address>
<birthdate>16/02/1981</birthdate>
<mobile_no>7075832396</mobile_no>
<blood_group>AB +ve</blood_group>
<disease_type>Hypertension</disease_type>
<BP>140</BP>
</patient>
</patientdetail>

patient.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 = "/">
<html>
<body>
<h2>Patient details</h2>
<table border = "1">
<tr bgcolor = "#9acd32">
<th>Patient ID</th>
<th>Patient Name</th>
<th>Gender</th>
<th>address</th>
<th>Birth date</th>
<th>Mobile no</th>
<th>Blood Group</th>
<th>Disease type</th>
<th>BP</th>
<th>Level</th>
</tr>

<xsl:for-each select = "patientdetail/patient">

<tr>
<td><xsl:value-of select = "@ID"/></td>
<td><xsl:value-of select = "patientname"/></td>
<td><xsl:value-of select = "gender"/></td>
<td><xsl:value-of select = "address"/></td>
<td><xsl:value-of select = "birthdate"/></td>
<td><xsl:value-of select = "mobile_no"/></td>
<td><xsl:value-of select = "blood_group"/></td>
<td><xsl:value-of select = "disease_type"/></td>
<td><xsl:value-of select = "BP"/></td>

<td>
<xsl:choose>
<xsl:when test = "BP > 120">
High
</xsl:when>

<xsl:when test = "BP = 120 ">


Normal
</xsl:when>

<xsl:otherwise>
Low
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

OUTPUT:
PROGRAM NO 8
Create a XML document Which contains details of Employee information like:
empid, firstname,, lastname, designation, salary and display the same as a table by using xsl:apply-
templates element by using XSLT.

employee.xml:

<?xml version = "1.0"?>


<?xml-stylesheet type = "text/xsl" href = "employee.xsl"?>
<employeedetail>
<employee empid = "101">
<employee_name>Rahul pande</employee_name>
<address>sadar,nagpur</address>
<mobile_no>7896325689</mobile_no>
<designation>Accountant</designation>
<salary>9000</salary>
</employee>
<employee empid = "102">
<employee_name>sunil batra</employee_name>
<address>trimurti nagar,nagpur</address>
<mobile_no>8896325789</mobile_no>
<designation>clerk</designation>
<salary>25000</salary>
</employee>
<employee empid = "103">
<employee_name>sonali patil</employee_name>
<address>Dighori,nagpur</address>
<mobile_no>9996325689</mobile_no>
<designation>Manager</designation>
<salary>45000</salary>
</employee>
</employeedetail>

employee.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="/">
<html>
<body>
<h2>Employee details</h2>

<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<xsl:template match="employeedetail/employee">
<p>
<xsl:apply-templates select="employee_name"/>
<xsl:apply-templates select="address"/>
<xsl:apply-templates select="mobile_no"/>
<xsl:apply-templates select="designation"/>
<xsl:apply-templates select="salary"/>

</p>
</xsl:template>
<xsl:template match="empid">
Employee id: <span style="color:#ff0000">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="employee_name">
employee name: <span style="color:red">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="address">
Address: <span style="color:pink">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="mobile_no">
mobile no: <span
style="color:green">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="designation">
Designation: <span style="color:red">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="salary">

salary: <span style="color:pink">


<xsl:value-of select="."/></span>
<br />
</xsl:template>
</xsl:stylesheet>

OUTPUT:
PROGRAM NO 9
Create a XML document Which contains details of Bank information like:
customer id, customername, accountnumber , accounttype , bankname branchname IFSCcode
Address and display the same as a table by using xsl:import element by using XSLT.

bank.xml

<?xml version = "1.0"?>


<?xml-stylesheet type = "text/xsl" href = "bank_import.xsl"?>
<bankdetails>
<customer id = "001">
<customername>Aryan Gupta</customername>
<accountnumber>3256897413</accountnumber>
<accounttype>Saving</accounttype>
<bankname>SBI</bankname>
<branchname>Medical sqare,nagpur</branchname>
<IFSCcode>SBIN00C</IFSCcode>
<Address>Dighori,nagpur</Address>
</customer>
<customer id = "002">
<customername>Rahul sharma</customername>
<accountnumber>3243897412</accountnumber>
<accounttype>Current</accounttype>
<bankname>HDFC</bankname>
<branchname>Nandanvan,nagpur</branchname>
<IFSCcode>HDFC0000128</IFSCcode>
<Address>Reshimbagh,nagpur</Address>
</customer>
<customer id = "003">
<customername>Pratik tripathi </customername>
<accountnumber>3296386398</accountnumber>
<accounttype>Saving</accounttype>
<bankname>IDBI</bankname>
<branchname>Hudkeshwar,nagpur</branchname>
<IFSCcode>IBKL0NEFT01</IFSCcode>
<Address>Dighori,name</Address>
</customer>
<customer id = "004">
<customername>Abhishek Bacchan </customername>
<accountnumber>3245386397</accountnumber>
<accounttype>Saving</accounttype>
<bankname>SBI</bankname>
<branchname>Narendranagar,nagpur</branchname>
<IFSCcode>SBIN00C</IFSCcode>
<Address>Jaripataka,name</Address>
</customer>
<customer id = "005">
<customername>Saurabh Ingale </customername>
<accountnumber>3296387896</accountnumber>
<accounttype>Saving</accounttype>
<bankname>HDFC</bankname>
<branchname>Pratapnagar,nagpur</branchname>
<IFSCcode>HDFC0000128</IFSCcode>
<Address>omkarnagar,nagpur</Address>
</customer>
</bankdetails>

bank.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 = "/">
<html>
<body>
<h2>Bank Information</h2>
<table border = "1">
<tr bgcolor = "pink">
<th>ID</th>
<th>Customer Name</th>
<th>Account number</th>
<th>Account type</th>
<th> Bank Name</th>
<th>Branch Name</th>

<th>IFSCcode</th>
<th>Address</th>
</tr>

<xsl:for-each select = "bankdetails/customer">

<tr>
<td><xsl:value-of select = "@id"/></td>
<td><xsl:value-of select = "customername"/></td>
<td><xsl:value-of select = "accountnumber"/></td>
<td><xsl:value-of select = "accounttype"/></td>
<td><xsl:value-of select = "bankname"/></td>
<td><xsl:value-of select = "branchname"/></td>
<td><xsl:value-of select = "IFSCcode"/></td>
<td><xsl:value-of select = "Address"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

bank_import:

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


<xsl:stylesheet version = "1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:import href = "bank.xsl"/>
<xsl:template match = "/">
<xsl:apply-imports/>
</xsl:template>
</xsl:stylesheet>

output:
PROGRAM NO 10:
Create a XML document Which contains details of matrimony registration information like:
id, firstname,, lastname, DOB, Height, complexion, Education, job, description, address, mobile no
and display the same as a table by using xsl:key element by using XSLT.

marraige.xml:
<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "marraige.xsl"?>
<Registration_details>
<information id = "001">
<firstname>Jay </firstname>
<lastname>Bhatiya</lastname>
<DOB>15/11/1993</DOB>
<Height>5"10</Height>
<complexion>Fair</complexion>
<Education>BE,MTech</Education>
<job_description>Mechanical Engineer</job_description>
<address>Dighori,nagpur</address>
<mobileno>9823567149</mobileno>
</information>
<information id = "024">
<firstname>Sonam</firstname>
<lastname>Verma</lastname>
<DOB>25/09/1992</DOB>
<Height>5"6</Height>
<complexion>Fair</complexion>
<Education>MBA</Education>
<job_description>Assistant Professor</job_description>
<address>sadar,nagpur</address>
<mobileno>9923567159</mobileno>
</information>
<information id = "005">
<firstname>Ankit </firstname>
<lastname>Tamankar</lastname>
<DOB>26/05/1993</DOB>
<Height>5"9</Height>
<complexion>Fair</complexion>
<Education>MSc(computer science)</Education>
<job_description>Asociate Professor</job_description>
<address>ramna maruti,nagpur</address>
<mobileno>7723567149</mobileno>
</information>
</Registration_details>
marraige.xsl:
<xsl:stylesheet version = "1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:key name = "lastname-search" match = "information" use = "lastname"/>
<xsl:template match = "/">
<html>
<body>
<h1> Marraige Registration Details</h1>
<table border = "1">
<tr bgcolor = "pink">
<th> ID</th>
<th> First Name</th>
<th> Last Name</th>
<th> DOB</th>
<th> Height</th>
<th>complexion</th>
<th>Education</th>
<th>Job Description</th>
<th>address</th>
<th>Mobile no</th>
</tr>
<xsl:for-each select = "key('lastname-search', 'Bhatiya')">
<tr>
<td> <xsl:value-of select = "@id"/> </td>
<td> <xsl:value-of select = "firstname"/> </td>
<td> <xsl:value-of select = "lastname"/> </td>
<td> <xsl:value-of select = "DOB"/> </td>
<td> <xsl:value-of select = "Height"/> </td>
<td> <xsl:value-of select = "complexion"/> </td>
<td> <xsl:value-of select = "Education"/> </td>
<td> <xsl:value-of select = "job_description"/> </td>
<td> <xsl:value-of select = "address"/> </td>
<td> <xsl:value-of select = "mobileno"/> </td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

OUTPUT:

PROGRAM NO 11:
Create a valid XML document containing details of a car like: id, company name, model, engine and
mileage by using XML Schema.

car.xml:
<?xml version="1.0" encoding="utf-8"?>
<cars
xmlns = "http://www.startertutorials.com/studentSchema"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation = "http://www.startertutorials.com/studentSchema
car.xsd">
<car id="c101">
<company>Maruthi</company>
<model>Swift</model>
<engine>1248cc</engine>
<mileage>20</mileage>
</car>
<car id="c102">
<company>Hyundai</company>
<model>i20</model>
<engine>1000cc</engine>
<mileage>15</mileage>
</car>
</cars>

car.xsd:

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


<xsd:schema
xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
targetNamespace =
"http://www.startertutorials.com/studentSchema"
xmlns = "http://www.startertutorials.com/studentSchema"
elementFormDefault = "qualified">
<xsd:element name="cars">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="car" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="company" type="xsd:string" />
<xsd:element name="model" type="xsd:string" />
<xsd:element name="engine" type="xsd:string" />
<xsd:element name="mileage" type="xsd:decimal" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</
xsd:complexType>
</xsd:element>
</xsd:schema>

OUTPUT:
PROGRAM NO 12:

Create a valid Enternal DTD document containing details of Stock market like:
sname,branch,contact validate with php file.

vision.xml
<?xml version = "1.0" encoding = "UTF-8" standalone = "no" ?>
<!DOCTYPE Stockmarket SYSTEM "vision.dtd">
<Stockmarket>
<sname>Bluechip tech</sname>
<branch>nine</branch>
<contact>(022) 245-8597</contact>
<sname>BSE</sname>
<branch>SEVEN</branch>
<contact>(022) 235-8545</contact>
<sname>NSE</sname>
<branch>FIVE</branch>
<contact>(022) 225-5497</contact>
</Stockmarket>

vision.dtd:
<?xml version="1.0"?>
<!ELEMENT Stockmarket (sname,branch,contact)>
<!ELEMENT sname (#PCDATA)>
<!ELEMENT branch (#PCDATA)>
<!ELEMENT contact (#PCDATA)>

prg5.php
<?php
$xml=new DOMDocument;
$xml-
>load('vision.xml');
if($xml->validate())
{
echo"It's a valid document";
}
else
{
echo"It's a not valid document";
}
?>
OUTPUT:
PROGRAM NO 13:

Create a valid Internal DTD document containing details of a car like: id, company name, model,
engine and mileage validate with php file.

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

<!DOCTYPE cars[
<!ELEMENT cars (car+)>
<!ELEMENT car (company, model, engine, mileage)>
<!ELEMENT company (#PCDATA)>
<!ELEMENT model (#PCDATA)>
<!ELEMENT engine (#PCDATA)>
<!ELEMENT mileage (#PCDATA)>
<!ATTLIST car id CDATA #REQUIRED>
]>

<cars>
<car id="c101">
<company>Maruthi</company>
<model>Swift</model>
<engine>1248cc</engine>
<mileage>20</mileage>
</car>
<car id="c102">
<company>Hyundai</company>
<model>i20</model>
<engine>1000cc</engine>
<mileage>15</mileage>
</car>
</cars>

prg2.php:
<?php
$xml=new DOMDocument;
$xml-
>load('car.xml');
if($xml->validate())
{
echo"It's a valid document";
}
else
{
echo"It's a not valid document";
}
?>

OUTPUT:
PROGRAM NO 14:
Create a valid DTD document for Newspaper Article by using Element, Attribute and Entity
building blocks validate with php file.

news.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE NEWSPAPER [

<!ELEMENT NEWSPAPER (ARTICLE+)>


<!ELEMENT ARTICLE (HEADLINE,BYLINE,LEAD,BODY,NOTES)>
<!ELEMENT HEADLINE (#PCDATA)>
<!ELEMENT BYLINE (#PCDATA)>
<!ELEMENT LEAD (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
<!ELEMENT NOTES (#PCDATA)>

<!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED>


<!ATTLIST ARTICLE EDITOR CDATA #IMPLIED>
<!ATTLIST ARTICLE DATE CDATA #REQUIRED>
<!ATTLIST ARTICLE EDITION CDATA #IMPLIED>

<!ENTITY NEWSPAPER "Vervet Logic Times">


<!ENTITY PUBLISHER "Vervet Logic Press">
<!ENTITY COPYRIGHT "Copyright 1998 Vervet Logic Press">

]>
<NEWSPAPER>
<ARTICLE AUTHOR="Ravi" EDITOR="Tom" DATE="5/2/11" EDITION="vol32">
<HEADLINE>INDIA WINS THE MATCH</HEADLINE>
<BYLINE>&PUBLISHER;</BYLINE>
<LEAD>ANUJ &NEWSPAPER;</LEAD>
<BODY>INDIA BEAT DUTCH</BODY>
<NOTES>&COPYRIGHT;</NOTES>
</ARTICLE>
<ARTICLE AUTHOR="Eric" EDITOR="Robert" DATE="8/2/11" EDITION="vol39">
<HEADLINE>ARSNEL Beat MANU</HEADLINE>
<BYLINE>&PUBLISHER; </BYLINE>
<LEAD>ANUJ &NEWSPAPER;Eric Donald</LEAD>
<BODY>INDIA BEAT DUTCH</BODY>
<NOTES>&COPYRIGHT;</NOTES>
</ARTICLE>
<ARTICLE AUTHOR="ROss" DATE="24/2/11">
<HEADLINE>Nickel back new album </HEADLINE>
<BYLINE>&PUBLISHER; </BYLINE>
<LEAD>ANUJ &NEWSPAPER;Kyra Jhonson</LEAD>
<BODY>Someday Hit song</BODY>
<NOTES>&COPYRIGHT;</NOTES>
</ARTICLE>
</NEWSPAPER>

prg3.php:
<?php
$xml=new DOMDocument;
$xml-
>load('news.xml');
if($xml->validate())
{
echo"It's a valid document";
}
else
{
echo"It's a not valid document";
}
?>

OUTPUT:
PROGRAM NO-15

Create a XML document to parse an XML string into an XML DOM object and then
extract the information of important note.
<!DOCTYPE html>
<html>
<body>
<h1><font color="red">Important Note</font></h1>
<div>
<b>To:</b> <span id="to"></span><br>
<b>From:</b> <span id="from"></span><br>
<b>Message:</b> <span id="message"></span>
</div>
<script>
txt1="<note>";
txt2="<to>Sania Mirza</to>";
txt3="<from>Serena William</from>";
txt4="<body>Don't forget me this weekend!</body>";
txt5="</note>";
txt=txt1+txt2+txt3+txt4+txt5;

if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(txt,"text/xml");
}
else // Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(txt);
}
document.getElementById("to").innerHTML= xmlDoc.getElementsByTagName("to")
[0].childNodes[0].nodeValue; document.getElementById("from").innerHTML=
xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
document.getElementById("message").innerHTML= xmlDoc.getElementsByTagName("body")
[0].childNodes[0].nodeValue;
</script>
</body>
</html>

Output:
PROGRAM NO-16
Create a valid XML document congaing details of Breakfast menu like:name,price,
Description,calories food by using XML Schema.

breakfast.xml:
<?xml version="1.0" encoding="UTF-8"?>
<breakfast_menu xsi:noNamespaceSchemaLocation="breakfast.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>
Two of our famous Belgian Waffles with plenty of real maple syrup
</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>
Light Belgian waffles covered with strawberries and whipped cream
</description>
<calories>900</calories>
</food>
<food>
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price>
<description>
Belgian waffles covered with assorted fresh berries and whipped cream
</description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description>
Thick slices made from our homemade sourdough bread
</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>
Two eggs, bacon or sausage, toast, and our ever-popular hash browns
</description>
<calories>950</calories>
<food>
</breakfast_menu>

breakfast.xsd:

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


<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="breakfast_menu">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="food">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" />
<xs:element name="price" type="xs:string" />
<xs:element name="description" type="xs:string" />
<xs:element name="calories" type="xs:unsignedShort" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

OUTPUT:

changes in calaries:
PROGRAM NO-17
Create a valid XML document of train information like:train title,train type ,name, number, source and
destination by using DTD and CSS.

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

<!DOCTYPE rail_info SYSTEM "rail_info.dtd">


<?xml-stylesheet type="text/css" href="rail_info.css"?>
<rail_info>

<train_info>
<title1>Information about the trains</title1>

<train>
<type>SuperFast</type>
<name>GaribRath</name>
<no>12495</no>
<source>Delhi</source>
<dest>Patna</dest>
</train>
</train_info>

<station_info>
title2>Information about the station</title2>
<station>
<name>Patna</name>
<code>A01</code>
<zone>North East</zone>
<no_train_stop>50</no_train_stop>
<no_train_pass>50</no_train_pass>
</station>
</station_info>

<zone_info>
<title2>Information about the zone</title2>
<zone>
<name>North East</name>
<code>A02</code>
<no_of_st>100</no_of_st>
</zone>
</zone_info>

</rail_info>

rail_info.dtd:

<!ELEMENT rail_info (train_info,station_info,zone_info)>


<!ELEMENT train_info (title1,train+)>
<!ELEMENT train (type,name,no,source,dest)>
<!ELEMENT station_info (title2,station+)>
<!ELEMENT station (name,code,zone,no_train_stop,no_train_pass)>
<!ELEMENT zone_info (title3,zone+)>
<!ELEMENT zone (name,code,no_of_st)>
<!ELEMENT type (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT no (#PCDATA)>
<!ELEMENT source (#PCDATA)>
<!ELEMENT dest (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT code (#PCDATA)>
<!ELEMENT zone (#PCDATA)>
<!ELEMENT no_train_stop (#PCDATA)>
<!ELEMENT no_train_pass (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT code (#PCDATA)>
<!ELEMENT zone (#PCDATA)>

train_info.css:
rail_info
{
background-color: yellow;
width: 100%;
}
train_info,station_info,zone_info,train,station,zone
{
display: block;
margin-bottom:
30pt; margin-left: 0;
}
title1,title2,title3
{
color: green;
font-size:
20pt;
}
type,name
{
color: blue;
font-size:
20pt;
}

code,no,source,dest,zone,no_train_stop,no_train_pass,code,no_of_st
{
display: block;
color: pink;
margin-left:
20pt;
}

OUTPUT:
PROGRAM NO-18
Create a valid xml document to encode TV Program Schedules by using External DTD
validate with php file.

tv.xml:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE TVSCHEDULE SYSTEM "tv.dtd">

<TVSCHEDULE NAME="Salem Access Television">


<CHANNEL CHAN="15">
<BANNER>Channel 15 Government/Educational Schedule Monday, April 26th--Sunday,
May 2nd</BANNER>
<DAY>
<DATE>Monday, April 26th, 2022</DATE>
<PROGRAMSLOT>
<TIME>3:00 PM</TIME>
<TITLE>Inside Salem with George Ahmed</TITLE>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>6:00 PM</TIME>
<TITLE>Books Alive! XXII</TITLE>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>5:00 PM</TIME>
<TITLE>SHS Mock City Council and School Committee</TITLE>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>7:00 PM</TIME>
<TITLE>Foresight</TITLE>
<DESCRIPTION>Business Education and Finance</DESCRIPTION>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>7:30 PM</TIME>
<TITLE>Massachusetts Today with George T. O'Brine</TITLE>
<DESCRIPTION>Presenting the March of Dimes</DESCRIPTION>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>8:30 PM</TIME>
<TITLE>Public Hearing Regarding Transfer of Cable License</TITLE>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>9:30 PM</TIME>
<TITLE>Ward 4 Gallows Hill Community Group</TITLE>
<DESCRIPTION>4/20/99</DESCRIPTION>
</PROGRAMSLOT>
</DAY>

<DAY>
<DATE>Tuesday, April 27th, 2022</DATE>
<PROGRAMSLOT>
<TIME>12:00 PM</TIME>
<TITLE>Salem City Council Meeting</TITLE>
<DESCRIPTION>Meeting of 4/21/22</DESCRIPTION>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>6:30 PM</TIME>
<TITLE>A Conversation With Congressman Tierney</TITLE>
</PROGRAMSLOT>
<PROGRAMSLOT>
<TIME>7:00 PM</TIME>
<TITLE>Salem School Committee Meeting</TITLE>
<DESCRIPTION>4/26/2022</DESCRIPTION>
</PROGRAMSLOT>
</DAY>
</CHANNEL>
</TVSCHEDULE>

tv.dtd:
<!ELEMENT TVSCHEDULE (CHANNEL+)>
<!ATTLIST TVSCHEDULE NAME CDATA #REQUIRED>
<!ELEMENT CHANNEL (BANNER, DAY+)>
<!ATTLIST CHANNEL CHAN CDATA #REQUIRED>
<!ELEMENT BANNER (#PCDATA)>
<!ELEMENT DAY ((DATE, HOLIDAY) | (DATE, PROGRAMSLOT+))+>
<!ELEMENT HOLIDAY (#PCDATA)>
<!ELEMENT DATE (#PCDATA)>
<!ELEMENT PROGRAMSLOT (TIME, TITLE, DESCRIPTION?)>
<!ATTLIST PROGRAMSLOT VTR CDATA #IMPLIED>
<!ELEMENT TIME (#PCDATA)>
<!ELEMENT TITLE (#PCDATA)>
<!ATTLIST TITLE RATING CDATA #IMPLIED LANGUAGE CDATA #IMPLIED>
<!ELEMENT DESCRIPTION (#PCDATA)>

OUTPUT:
PROGRAM NO-19
Write a program to create a valid XML document for A simple address book to store the following
information: The person name, Home address, state,pincode, Telephone number, FAX number, Mobile
number E-mail address by using XML schema.

address.xml:
<?xml version="1.0" encoding="UTF-8"?>
<address_book xsi:noNamespaceSchemaLocation="address.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<name> Rajesh tripathi</name>
<home_address>Dattawadi,nagpur</home_address>
<state>Maharastra</state>
<pincode>4400023</pincode>
<Telephone_no>(0712-224578)</Telephone_no>
<fax_no>555-123-4567</fax_no>
<mobile_no>9875462312</mobile_no>
<Email_ID>[email protected]</Email_ID>

<name> Dhiraj patil</name>


<home_address>Trimurthi nagar,nagpur</home_address>
<state>Maharastra</state>
<pincode>4400026</pincode>
<Telephone_no>(0712-224585)</Telephone_no>
<fax_no>555-133-4667</fax_no>
<mobile_no>9976462312</mobile_no>
<Email_ID>[email protected]</Email_ID>

<name> Rahul pande</name>


<home_address>prajapati nagar,nagpur</home_address>
<state>Maharastra</state>
<pincode>4400036</pincode>
<Telephone_no>(0712-204587)</Telephone_no>
<fax_no>555-123-5667</fax_no>
<mobile_no>776862312</mobile_no>
<Email_ID>[email protected]</Email_ID>

</address_book>

address.xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="address_book">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="name" type="xs:string" />
<xs:element name="home_address" type="xs:string" />
<xs:element name="state" type="xs:string" />
<xs:element name="pincode" type="xs:unsignedInt" />
<xs:element name="Telephone_no" type="xs:string" />
<xs:element name="fax_no" type="xs:string" />
<xs:element name="mobile_no" type="xs:unsignedLong" />
<xs:element name="Email_ID" type="xs:string" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

OUTPUT:
changes in pincode:
PROGRAM NO-20
Create a valid xml document to show the information about subject topics by using css
topic.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="topic.css"?>
<topics>
<title>Hello Everyone! </title>
<topic_section>
<name>Algorithm</name>
<topic1> Recursive Algorithm</topic1>
<topic2>Randomised Algorithm</topic2>
<topic3>Searching Algorithm</topic3>
<topic4>Sorting Algorithm</topic4>
</topic_section>
<topic_section>
<name>Data Structures</name>
<topic1>Array</topic1>
<topic2>Stack</topic2>
<topic3>Queue</topic3>
<topic4>Linked List</topic4>
</topic_section>
<topic_section>
<name>Web Technology</name>
<topic1>HTML</topic1>
<topic2>CSS</topic2>
<topic3>Java Script</topic3>
<topic4>Php</topic4>
</topic_section>
<topic_section>
<name>Languages</name>
<topic1>C/C++</topic1>
<topic2>Java</topic2>
<topic3>Python</topic3>
<topic4>Ruby</topic4>
</topic_section>
<topic_section>
<name>DBMS</name>
<topic1>Basics</topic1>
<topic2>ER Diagram</topic2>
<topic3>Normalization</topic3>
<topic4>Transaction Concepts</topic4>
</topic_section>
</topics>

topic.css
topic
{
font-size:80%;
margin:0.5em;
font-family: Verdana;
display:block;
}
topic_section {
display:block
;
border: 1px solid silver;
margin:0.5em;
padding:0.5em;
background-color:whitesmoke;
}
title {
display:block;
font-
weight:bolder;
text-align:center;
font-size:30px;
background-color: green;
color: white;

}
name, topic1, topic2, topic3, topic4 {
display:block;
text-align:center;
}
name {
color:green;
text-decoration:
underline ; font-
weight:bolder;
font-size:20px;
}
topic1 {
color:green
}
topic2 {
color:brown
}
topic3 {
color:blue
}
topic4 {
color:orange
}

output:

You might also like