0

Can anyone explain the prime difference between doing something like:

<car> <color> Blue </color> </car>

VERSUS

<car color="blue" />
Tom V
  • 79
  • 5

1 Answers1

1

Difference is only in logical meaning. Usually inner elements are used to store data, and attributes - to express a property or behavior (that is not a part of the data).

Attributes can't contain multiple values, describe structures and they are not expandable (for future changes).

whyleee
  • 4,019
  • 1
  • 31
  • 33