Documente Academic
Documente Profesional
Documente Cultură
Lab 1:
1. Create an XML document template to describe the results of students in an examination. The description should include the
student’s roll number, name, three subject names and marks, total marks, percentage, and result.
<student>
<name>Ishu Khanchi</name>
<rno>80</rno>
<subjectname>
<sub1>Maths</sub1>
<sub2>Physics</sub2>
<sub3>Chemistry</sub3>
</subjectname>
<subjectmarks>
<marks1>77</marks1>
<marks2>78</marks2>
<marks3>80</marks3>
</subjectmarks>
<total>70+77+78</total>
<percentage>[(70+77+78)/3]*100</percentage>
<result>The final result is displayed.</result>
</student>
3. With reference to the above question, describe the various XML terms found there.
Lab 2:
3. Suppose we want to store information regarding employees in the following format in XML. Show such a file with one example.
<company>
<Employee>
<Employee_ID type='numeric'>1</Employee_ID>
<Employee_Name type='Alphanumeric'>Anupriya</Employee_Name>
<Employee_Dept type='Alphanumeric'>Chemical</Employee_Dept>
<Role type='Alphanumeric'>Advisor</Role>
<Manager type='Alphanumeric'>XYZ</Manager>
</Employee>
<Employee>
<Employee_ID type='numeric'>2</Employee_ID>
<Employee_Name type='Alphanumeric'>Poulomi</Employee_Name>
<Employee_Dept type='Alphanumeric'>Metallurgy</Employee_Dept>
<Role type='Alphanumeric'>Analyst</Role>
<Manager type='Alphanumeric'>XYZ</Manager>
</Employee>
<Employee>
<Employee_ID type='numeric'>3</Employee_ID>
<Employee_Name type='Alphanumeric'>Anjali</Employee_Name>
<Employee_Dept type='Alphanumeric'>science</Employee_Dept>
<Role type='Alphanumeric'>consultant</Role>
<Manager type='Alphanumeric'>XYZ</Manager>
</Employee>
</company
4. Suppose our banking application allows the user to perform an online funds transfer. This application generates an XML message, which
needs to be sent to the database for actual updates. Create such a sample message, containing the following details:
<bank>
<emp1>
<transaction_ref_no type="numeric">111</transaction_ref_no>
<from type="numeric">32217846083</from>
<to type="numeric">3425897659089</to>
<amount type="numeric">12333</amount>
<date type="timestamp">11-11-11 12:23:40</date>
</emp1>
<emp2>
<transaction_ref_no type="numeric">112</transaction_ref_no>
<from type="numeric">32217846044</from>
<to type="numeric">3423765868754</to>
<amount type="numeric">134563</amount>
<date type="timestamp">11-11-16 06:25:40</date>
</emp2>
<emp3>
<transaction_ref_no type="numeric">113</transaction_ref_no>
<from type="numeric">7459765446044</from>
<to type="numeric">989048768754</to>
<amount type="numeric">145563</amount>
<date type="timestamp">01-01-16 03:25:40</date>
</emp3>
</bank>
5. Consider that we want to capture information about a salesperson. Capture this information in an XML format.
<sales>
<s1>
<name>Rajesh</name>
<Address>NHGCLUGL</Address>
<phone>7830459568</phone>
<product_no>12</product_no>
<product_name>pens</product_name>
<quantity>500</quantity>
</s1>
<s2>
<name>Brijesh</name>
<Address>kjdhfiulgh</Address>
<phone>78750666645</phone>
<product_no>13</product_no>
<product_name>pensils</product_name>
<quantity>500</quantity>
</s2>
<s2>
<name>Hirani</name>
<Address>jefhlughorgh</Address>
<phone>478565896</phone>
<product_no>14</product_no>
<product_name>rulers</product_name>
<quantity>300</quantity>
</s2>
</sales>
Lab3:
1. Create library.xml file with the following constraints:
a. Library has book and member details
i. More than one book and member is possible
· id, name, author are mandatory fields. More than one author and ISBN number can be possible.
Create the XML document for at least 10 books and 10 members. Check the XML document for well formness.
<library>
<book>
<id>1</id>
<name>Graphics with OpenGL</name>
<author>Baker</author>
<ISBN>894760</ISBN>
</book>
<book>
<id>2</id>
<name>Computer System Architecture</name>
<author>Morris</author>
<ISBN>3487</ISBN>
</book>
<book>
<id>3</id>
<name>The discovery of India</name>
<author>Pt. Jawaharlal Nehru</author>
<ISBN></ISBN>
</book>
<book>
<id>4</id>
<name>uflerge</name>
<author>rkjghrliu</author>
<ISBN>7775</ISBN>
</book>
<book>
<id>5</id>
<name>erherile</name>
<author>uhrgiluhkd</author>
<ISBN>59879</ISBN>
</book>
<book>
<id>6</id>
<name>hklgr</name>
<author>krejlgrj</author>
<ISBN>8954978</ISBN>
</book>
<book>
<id>7</id>
<name>gfkkhusdrd</name>
<author>uigulhkj</author>
<ISBN>8748</ISBN>
</book>
<book>
<id>8</id>
<name>hlflkjh</name>
<author>jeklhjkfd</author>
<ISBN>63844</ISBN>
</book>
<book>
<id>9</id>
<name>fkhelfnf</name>
<author>krhehjhje</author>
<ISBN>43768</ISBN>
</book>
<book>
<id>10</id>
<name>lkfejefkl</name>
<author>khlfk</author>
<ISBN>8474</ISBN>
</book>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>
<member>
<id></id>
<password></password>
<name></name>
<age></age>
<email></email>
<phone></phone>
<pan></pan>
<pass></pass>
</member>