Computer Science, asked by kakoleedevmazumder, 8 months ago

: how to create a valid xml document that satisfies the following : * root element is 'quiz' * 'quiz' contains the elements 'title' and 'items' *'items' contains one or more < item> elements * 'item' contains one question and four answer tags *one of the answer tags must have an attribute 'and="y" ' ; indicates the correct answer *question tag might appear before all the answers

Answers

Answered by AskewTronics
6

The XML for the above document is as follows:

Explanation:

<?xml version="1.0"?>

<quiz>

       <title>

       </title>

       <items>

           <item>

               <question>

                   Question

               </question>

               <correctanswer>

                   ans:"Y"

               </correctanswer>

               <Answer>

                   1 answer

               </Answer>

               <Answer>

                   2 answer

               </Answer>

               <Answer>

                   3 answer

               </Answer>

               <Answer>

                   4 answer

               </Answer>

           </item>

       </items>

   </quiz>

Code Explanation:

  • The above code is an XML code that is designed for the question problem. The question and answer are written on the place of "question" and "answer 1", "answer 2", "answer 3" and "answer 4". The correct answer symbol is written on the place of "y", which is defined on the correct answer tag.
  • When a person wants to write the XML code then he can write by the help to make the element which can be the name of the tag. It is because there is no predefined tag used in XML.

Learn More:

  • XML : https://brainly.in/question/9009020
Similar questions