The document outlines 12 practical assignments for creating XML documents and their associated DTDs. The assignments involve creating XML documents to store personal, order, student, book, email, and other data, and defining DTDs that specify element sequences, attributes, data types and other constraints for the XML documents.
The document outlines 12 practical assignments for creating XML documents and their associated DTDs. The assignments involve creating XML documents to store personal, order, student, book, email, and other data, and defining DTDs that specify element sequences, attributes, data types and other constraints for the XML documents.
0301406: Introduction to XML Practical Assignment 2
1. Create an XML document for storing personal information about
student where it contains the following data: Personal Info( Roll no, Name, Address, Mobile, DOB, Age, Qualification) Create An External DTD for the above XML document. 2. Create an XML document email where it contain the following data: Email(message) as an element and Message(from, to, subject)as an attribute. Create a DTD for the following XML document. 3. Create XML document OrderDetail where it contains the following data: Order_Detail(OrderNumber, Orderate, OrderAmount,ItemPrice, ItemName, Quantity) Create DTD declaration for OrderDetail where • OrderDate will appear as an attribute to OrderNumber • ItemName should come at least one time. • Order Amount should come only once. • Item Price and Quantity can come zero or more times. 4. Create XML document for Student where it contains the following data: Student Name, Personal Info (Address, Birthdate,Gender, Mobile No, Address) ,Result(Total, Percentage, Grade) Create External DTD declaration for Student where • Gender has only two choices Male and Female as an element. • Grade element should have only one of these grade element (Pass, First, Dist., Second, Fail) 5. Create an XML document Books where it contains the following data : Books (book (title) as an attribute , author , year , publisher ). Create An External DTD for the above XML document where • Elements should be in sequense. • Attribute title should have only two values i.e XML or DCN 6. Create an XML document Student where it contains the following data :Student(Name (fname & Lname) , ID , Plan (courses) ). In courses element take (year) as an attribute and (course) as an sub-element . And Course has name , shortName , record as its sub element. And again record has its sub element Grade , date. Create An External DTD for the above XML document where : • Courses element can zero or more course. • Year attribute must appear in the element. • Record element should appear zero or more times. 7. Create an XML document Email where it contains the following data : Email (from , to ,content ( person , exercises(exercise (topic , description) ) , course ). Create An External DTD for the above XML document where • Content element of email should be mixed content. • Exercises can have multiple exercise element. 8. Create an XML document Student where it contains the following data : Student (Roll_no , Name , Marks , Rank) Create An External DTD for the above XML document where • Marks element has web technologies , XML , J2EE ,NS as a sub- element • Marks can have only the above elements. 9. Create an XML document Letter where it contains the following data : Letter (contact (name , address , city ,pin ,state , flag) , salutation , paragraph , closing , signature ) . The “contact “ element has an attribute “type” where it will declare type of person (eg : manager , officer etc as a value) . Create An External DTD for the above XML document where • contact should come atleast once. • flag element should an empty element • “flag” element has an attribute “gender” where it will declare as a male or female as a value and male as a default value. • The attribute type has a fixed value “sender” 10. Create an XML document Student_info where it contains the following data : Student((which_course as attribute), name, contact_no), Course((c_id as attribute), name), subject(name as attribute) Create An External DTD for the above XML document where • student can be one or more times • c_id as id and which_course as referance id. • Make one entity of your choice and use in document. • Make enumerated attributes of subject name as Java, xml, OS • Make contact_no as nmtoken 11. In Question 4 Use conditional statement INCLUDE of student personal information DTD and IGNORE of result DTD) 12. Create an XML document for storing the India Team details where it contains the following data: Team Name,Player Detail( PID, PName, Position,Role) Create An External DTD for the above XML document.
XML: Introduction To XML, Defining XML Tags, Their Attributes and Values, Document Type Definition, XML Schemas, Document Object Model, XHTML. Parsing XML Data - DOM and SAX Parsers in Java