Question

In: Computer Science

Exercise 2: Write an XML document describing a person: name, occupation, address and hobbies. Please do...

Exercise 2:

Write an XML document describing a person: name, occupation, address and hobbies. Please do not use your own information, you can use fake data. Decide on suitable element names and nesting. Check your document for well-formedness.

Exercise 3:

Draw a tree that represents the XML document you created in task 2.

Solutions

Expert Solution

SOLUTION-

Exercise 2:

CODE-

<?xml version="1.0" encoding="iso-8859-1"?>

<person>

    <name>

        <gname>Oskari</gname>

        <fname>Heinonen</fname>

    </name>

   

    <occupation>assistant</occupation>

   

    <address>

        <affil>Univ. of Helsinki, Dept. of Computer Science</affil>

        <pbox>P.O. Box 68</pbox>

        <street>Gustaf Hällströmin katu 2b</street>

        <pcode>FI-00014</pcode>

        <plocale>University of Helsinki</plocale>

    </address>

   

    <hobbies>

        <hobby>eating</hobby>

        <hobby>sleeping</hobby>

    </hobbies>

   

</person>

Sample output for the xml:

Validity of XMl code:

Exercise 3 )

IF YOU HAVE ANY DOUBT PLEASE COMMENT DOWN BELOW I WILL SOLVE IT FOR YOU:)
----------------PLEASE RATE THE ANSWER-----------THANK YOU!!!!!!!!----------


Related Solutions

Please Write an XML document describing a person: name, occupation, address, and hobbies. Decide on suitable...
Please Write an XML document describing a person: name, occupation, address, and hobbies. Decide on suitable element names and nesting. Check your document for well-formedness. And draw a tree that represents the XML document you created. Thanks
Write a DTD for this XML document such that the corrected version of the example is...
Write a DTD for this XML document such that the corrected version of the example is a valid XML document <?xml version="1.0"?> <computers> <item type = "Laptop" code = "Dell437">    <make>    <brand>Dell Inspiration</Brand>    <supplier id = "Dell"/>    </make>    <spec>    <cpu speed = "900"/>    <harddisk size = "12" units = "GB"/>    </Spec>    <price n = "950" units = "USD"/> </item> <item type = "Desktop" code = "Apple1679">    <make>    <brand>Apple iMac</brand>...
Consider the XML DTD definition below. Write a well-formed and valid XML Document that conforms to...
Consider the XML DTD definition below. Write a well-formed and valid XML Document that conforms to this definition. <!ELEMENT wine-catalog (wine+)> <!ELEMENT wine (properties,origin,price,year,tasting-note?)> <!ATTLIST wine    code   ID #REQUIRED name   #PCDATA #REQUIRED    classification #PCDATA #REQUIRED format (375ml|750ml) “750ml”> <!ELEMENT properties (color,alcohol-content)> <!ELEMENT color (#PCDATA)> <!ELEMENT alcohol-content (#PCDATA)> <!ELEMENT origin (country, region, producer)> <!ELEMENT country (#PCDATA)> <!ELEMENT region (#PCDATA)> <!ELEMENT producer (#PCDATA)> <!ELEMENT price (#PCDATA)> <!ELEMENT year (#PCDATA)> <!ELEMENT tasting-note (#PCDATA)>
1. The following XML document describes some employees of a company. <?xml version="1.0" encoding="UTF-8"?> <company> <person...
1. The following XML document describes some employees of a company. <?xml version="1.0" encoding="UTF-8"?> <company> <person age="25" id="p29432" manager="p48293"> <ssn>123456789</ssn> <name> John Davis</name> <office>B432</office> <phone>1234</phone> </person> <person age="27" id="p29333" manager="p48222"> <ssn>987654321</ssn> <name>Jim Handler</name> <office>B123</office> </person> <person age=55 id="p29432" manager="p48221"> <ssn>123456789</ssn> <name> Christo Dichev</name> <office>A4210</office> <phone>2477</phone> </person> <person age="57" id="p29333" manager="p4832"> <ssn>987654321</ssn> <name>Elva Jones</name> <office>A4211</office> </person> </company> 1. Check if the XML document is well-formed. If it is not, change it so that it becomes wellformed, making as little changes as...
Create and test an HTML document for yourself, including your name, address, and electronic mail address....
Create and test an HTML document for yourself, including your name, address, and electronic mail address. If you are a student, you must include your major and your grade level. If you work, you must include your employer, your employer’s address, and your job title. This document must use several headings and <em>, <strong>, <hr />, <p>, and <br /> tags. 2.2 Add pictures of yourself and at least one other image (of your friend, spouse, or pet) 2.3 Add...
Need C++ code for following with a document describing the code as well: Write a program...
Need C++ code for following with a document describing the code as well: Write a program to implement the game of Tic Tac Toe Four. The game is played on a 4 × 4 chessboard, within 2 players. The player who is playing "X" always goes first. Players alternate placing Xs and Os on the board until either one player has four in a row, horizontally, vertically, or diagonally; or all 16 squares are filled(which is a draw). The program...
Exercise: Developing a Job Description Select the healthcare profession or occupation and write a job description...
Exercise: Developing a Job Description Select the healthcare profession or occupation and write a job description for it. It will be most helpful to use an occupation in which you have worked or for which you are preparing. Following completion of the job description, prepare a condensed description of that job in less than one-half page that could be used for recruiting purposes. MY JOB OF CHOICE PEDIATRIC NURSE
Please do not write in handwriting and The answer is not similar to another person. (Finance...
Please do not write in handwriting and The answer is not similar to another person. (Finance 101) DISCUSSION 1. You are planning to take a spring break trip to Canada your senior year. The trip is exactly two years away, but you want to be prepared and have enough money when the time comes. Explain how you would determine the amount of money you will have to save in order to pay for the trip. 2. Identify the steps involved...
The Person Class Uses encapsulation Attributes private String name private Address address Constructors one constructor with...
The Person Class Uses encapsulation Attributes private String name private Address address Constructors one constructor with no input parameters since it doesn't receive any input values, you need to use the default values below: name - "John Doe" address - use the default constructor of Address one constructor with all (two) parameters one input parameter for each attribute Methods public String toString() returns this object as a String, i.e., make each attribute a String, concatenate all strings and return as...
(Java) Design a class named Person with fields for holding a person’s name, address, and telephone...
(Java) Design a class named Person with fields for holding a person’s name, address, and telephone number. Write one or more constructors and the appropriate mutator and accessor methods for the class’s fields. Next, design a class named Customer, which extends the Person class. The Customer class should have a field for a customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write one or more constructors and the appropriate mutator and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT