5. VTU WEB TECHNOLOGY LAB | READ NOW
VTU WEB TECHNOLOGY LAB
5] DESIGN AN XML DOCUMENT TO STORE INFORMATION ABOUT A STUDENT IN AN ENGINEERING COLLEGE AFFILIATED WITH VTU. THE INFORMATION MUST INCLUDE USN, NAME, AND NAME OF THE COLLEGE, BRANCH, YEAR OF JOINING, AND EMAIL ID. MAKEUP SAMPLE DATA FOR 3 STUDENTS. CREATE A CSS STYLE SHEET AND USE IT TO DISPLAY THE DOCUMENT
STEPS TO EXECUTE XML PROGRAM
- Copy the xml code given below
- Save it with .xml file name extension
- Place the file in the htdocs of XAAMP
- Start the XAAMP control panel
- Start Apache server
- Click on admin in XAMPP Control pale
- Replace the url dashboard name with your xml file name
- Execution completed
Solution 1 – [prog5.xml]
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/css" href="PROG5.css"?> <STUDENTDATA> <STUDENT> <USN>USN : 3GN16CS002</USN> <NAME>NAME : ABHISHEK MALI</NAME> <COLLEGE>COLLEGE : GNDECB</COLLEGE> <BRANCH>BRANCH :CSE</BRANCH> <YEAR>YEAR : 2019</YEAR> <EMAIL>E-MAIL : abhishek@gmail.com</EMAIL> </STUDENT> <STUDENT> <USN>USN : 3GN16CS029</USN> <NAME>NAME : KESHAV POLA</NAME> <COLLEGE>COLLEGE : GNDECB</COLLEGE> <BRANCH>BRANCH :CSE</BRANCH> <YEAR>YEAR : 2019</YEAR> <EMAIL>E-MAIL : keshav@gmail.com</EMAIL> </STUDENT> <STUDENT> <USN>USN : 3GN16CS027</USN> <NAME>NAME : KARAN DANGE</NAME> <COLLEGE>COLLEGE : GNDECB</COLLEGE> <BRANCH>BRANCH :CSE</BRANCH> <YEAR>YEAR : 2019</YEAR> <EMAIL>E-MAIL : karan@gmail.com</EMAIL> </STUDENT> </STUDENTDATA>
WEB TECHNOLOGY Solution 1 [prog5.css]
*{ display: block; font-size: 20px; } USN { color: blue; font-size: 30px; margin-top: 20px; }
WEB TECHNOLOGY – Output
WEB TECHNOLOGY Solution 2- [prog5.xml]
<?xml-stylesheet type="text/css" href="5.css" ?> <!DOCTYPE HTML> <html> <head> <h1> STUDENTS DESCRIPTION </h1> </head> <students> <student> <USN>USN : 3GN07CS001</USN> <name>NAME : SANTHOSH</name> <college>COLLEGE : GNDEC</college> <branch>BRANCH : Computer Science and Engineering</branch> <year>YEAR : 2007</year> <e-mail>E-Mail : santosh@gmail.com</e-mail> </student> <student> <USN>USN : 3GN07IS001</USN> <name>NAME : MANORANJAN</name> <college>COLLEGE : GNDEC</college> <branch>BRANCH : Information Science and Engineering</branch> <year>YEAR : 2007</year> <e-mail>E-Mail : manoranjan@gmail.com</e-mail> </student> <student> <USN>USN : 3GN07EC001</USN> <name>NAME : CHETHAN</name> <college>COLLEGE : GNDEC</college> <branch>BRANCH : Electronics and Communication Engineering </branch> <year>YEAR : 2007</year> <e-mail>E-Mail : chethan@gmail.com</e-mail> </student> </students> </html> prog5.css student{ display:block; margin-top:10px; color:Navy; } USN{ display:block; margin-left:10px;font-size:14pt; color:Red; } name{ display:block; margin-left:20px;font-size:14pt; color:Blue; } college{ display:block; margin-left:20px;font-size:12pt; color:Maroon; } branch{ display:block; margin-left:20px;font-size:12pt; color:Purple; } year{ display:block; margin-left:20px;font-size:14pt; color:Green; } e-mail{ display:block; margin-left:20px;font-size:12pt; color:Blue; }