Some problems generated by using attributes
- attributes cannot contain multiple values (child
elements can)
- future changes attributes are not easily expandable
- attributes cannot show the structures (child elements
can)
- Nanipulating attributes are more difficult by program
code
- attribute values are not easy to test against a Document
Type Definition (DTD) - which is used to define the legal
elements of an XML document
If you use attributes as containers for data, you end up with
documents that are difficult to read and maintain. Try to use
elements to describe data. Use attributes only to provide
information that is not relevant to the data.
Don't end up like this (this is not how XML should be used):
|