JAVA XML FULL STACK DEVELOPMENT
Objectives of this Lab Manual This lab manual includes - Exercises for hands on practice Guidelines to complete the exercise Learning Outcome
Creating an XML document and a DTD for the database
Problem What will you do? Statement Design an XML (Extensible Markup Language) document for a database of animals. The root element should be ‘animal’. There should be an intermediate ‘vertebrates’ element containing all the child elements. The child elements should be name, species, and blood. Also, design a valid DTD (Document Type Definition).
Solution What will be the steps Steps to get the output? • Step1: Open a text document and save it with .xml extension. • Step 2: Write a prolog for the XML document. Step 3: Link a DTD corresponding to the XML document. Later design the DTD.
Solution What will be the steps Steps to get the output? • Step 4: Design the XML documents with mentioned root elements and child elements. • Step 5: Open a text document and save it as ‘animal.dtd’ with a .dtd extension. Observe the XML and appropriately create a DTD for validation.
Code Code for step 2: <?xml version=\"1.0\" encoding=\"UTF-8\"?> Code for step 3: <!DOCTYPE animal SYSTEM ‘animal.dtd’>
Output Raw Output: Output for the Adedxetercxitsheewreil:l- be :- Formated Output:
Learning Outcome After Performing this Add teExxt ehrecries:e- You will be able to successfully transfer data from one system to another, carry information about your website efficiently, complement your HTML document and provide additional support, store complex data structures for the website, and understood the structure of XML and DTD, successfully created an XML and a valid DTD for the sample animal database.
Happy Learning!
Search
Read the Text Version
- 1 - 10
Pages: