Question

This is an XML exercise. Change the format of the appUsers.xml document (see below) to remove...

This is an XML exercise.

Change the format of the appUsers.xml document (see below) to remove the attributes and use elements to store the data.

Then explain the main disadvantage to having the file in the format you’ve just created.

Bear in mind that data is often transmitted across networks rather than just being consumed where it is stored.

appUsers.xml:

<applicationUsers>
<user firstName=”Joe” lastName=”Fawcett” />
<user firstName=”Danny” lastName=”Ayers” />
<user firstName=”Catherine” lastName=”Middleton” />
</applicationUsers>

0 0
Add a comment Improve this question Transcribed image text
Answer #1

appUsers.xml

<?xml version="1.0"?>
<!DOCTYPE ApplicationUsers
[
<!ELEMENT ApplicationUsers (user1,user2,user3)>
<!ELEMENT user1 (firstName1,lastName1)>
   <!ELEMENT user2 (firstName2,lastName2)>
   <!ELEMENT user3 (firstName3,lastName3)>

   <!ELEMENT firstName1 (#PCDATA)>
<!ELEMENT lastName1 (#PCDATA)>

   <!ELEMENT firstName2 (#PCDATA)>
<!ELEMENT lastName2 (#PCDATA)>

<!ELEMENT firstName3 (#PCDATA)>
<!ELEMENT lastName3 (#PCDATA)>

]>
<ApplicationUsers>
<user1>
    <firstName1>Joe</firstName1>
    <lastName1>Fawcett</lastName1>
  
</user1>

   <user2>
    <firstName2>Danny</firstName2>
    <lastName2>Ayers</lastName2>
  
</user2>

   <user3>
    <firstName3>Catherine</firstName3>
    <lastName3>Middleton</lastName3>
  
</user3>

</ApplicationUsers>

VALIDATION

Add a comment
Answer #2

Hi,

Please look at the appUsers.xml after modifications according to above mentioned rule.

<applicationUsers>
<user>
<firstName>Joe</firstName>
<lastName>Fawcett</lastName>
</user>
<user>
<firstName>Danny</firstName>
<lastName>Ayers</lastName>
</user>
<user>
<firstName>Catherine</firstName>
<lastName>Middleton</lastName>
</user>
</applicationUsers>

  1. The Main disadvantage of providing the data in the format of elements is "It increases the number of lines if you have many entities to model" so your file looks clumsy after everything gets added.
  2. If certain entity is part of Data, then it is preferable to use element. For example, customer name, customer id are an essential part of the customer data.
  3. Now if you want to convey additional information about the data which is not really a part of data(METADATA) then it is better to make it an attribute.
Add a comment
Know the answer?
Add Answer to:
This is an XML exercise. Change the format of the appUsers.xml document (see below) to remove...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • you must implement public class Student by following the instructions as follows exactly. You may reference...

    you must implement public class Student by following the instructions as follows exactly. You may reference Chapter 7 for the similar examples to get the ideas and concepts. Each student must have the following 5 attributes (i.e., instance variables): private String   studentID ;              // student’s ID such as                         1 private String lastName   ;                         // student’s last name such as              Doe private String firstName ;             // student’s first name such as            John private double gpa...

  • First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below...

    First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT