Datasheet
<country name=”Comoros”>
<year1998>658</year1998>
<year2025>1176</year2025>
<year2050>1577</year2050>
</country>
...
</countries>
...
</continent>
...
</continents>
...
</world>
...
</populationInThousands>
Attributes can also be contained within an element as child elements. The example you just saw can be
altered as in the next script, removing all element attributes. The following script just looks busier and
perhaps a little more complex for the naked eye to decipher. The more important point to note is that the
physical size of the XML document is larger because additional termination elements are introduced. In
very large XML documents this can be a significant performance factor:
<populationInThousands>
<world>
<continents>
<continent>
<name>Africa</name>
<year1998>748,927</year1998>
<year2025>1,298,311</year2025>
<year2050>1,766,082</year2050>
<countries>
<country>
<name>Burundi</name>
<year1998>6457</year1998>
<year2025>11569</year2025>
<year2050>15571</year2050>
</country>
<country>
<name>Comoros</name>
<year1998>658</year1998>
<year2025>1176</year2025>
<year2050>1577</year2050>
</country>
...
</countries>
...
</continent>
...
</continents>
...
20
Chapter 1
04_791202 ch01.qxp 10/6/06 10:59 AM Page 20