July 2002
Intermediate to advanced
864 pages
22h 32m
English
It would be possible to create an entire document using nothing but elements. After all, you can use elements to mark up any kind of data. For example, we could describe a camera using only elements:
<camera> <manufacturer>Nikon</ manufacturer> <model>D1</model> <lens>28mm</lens> <format>35mm</format> </camera>
There is nothing wrong with this approach. In fact, often elements are more flexible than attributes, and can be easier to alter. However, we could also structure this XML using attributes:
<camera manufacturer="Nikon" model="D1" lens="28mm" format="35mm"> </camera>
With an example of this level of simplicity, there isn't really a huge impact in the differences between using elements versus attributes. However, ...