Datasheet

It follows that projected populations for the African continent are 1.3 billion (1,298,311) for the
year 2025, and 1.8 billion (1,766,082) for the year 2050. Also in this example, the name of the
country is stored in the XML document as an attribute of the
<country> element:
<?xml version=”1.0”?>
<?xml:stylesheet type=”text/xsl” href=”791202 fig0105.xsl” ?>
<populationInThousands>
<world>
<continents>
<continent name=Africayear1998=748,927year2025=1,298,311
year2050=1,766,082>
<countries>
<country name=”Burundi”>
<year1998>6457</year1998>
<year2025>11569</year2025>
<year2050>15571</year2050>
</country>
<country name=”Comoros”>
<year1998>658</year1998>
<year2025>1176</year2025>
<year2050>1577</year2050>
</country>
...
</country>
...
</continent>
...
</continents>
...
</world>
...
</populationInThousands>
XML element and attribute names can have space characters included in those names, as in the
<continent> element shown in the preceding sample XML document.
As shown in Figure 1-7, the previous sample XML document does include a style sheet, making
the XML document display with only the names of continents and countries.
And here is an HTML equivalent of the XML document for the previous example as shown in
Figure 1-7. Notice how much more raw code there is for each population region and country:
<HTML><BODY>
<TABLE CELLPADDING=”2” CELLSPACING=”0” BORDER=”1”>
<TR>
<TH BGCOLOR=”silver”>Continent
<TH BGCOLOR=”silver”>Country
<TH BGCOLOR=”silver”>1998
<TH BGCOLOR=”silver”>2025
<TH BGCOLOR=”silver”>2050
</TR>
15
What Is XML?
04_791202 ch01.qxp 10/6/06 10:59 AM Page 15