Page 113 - Electronic Commerce
P. 113
Chapter 2
themselves, such as prices, identification numbers, and quantities on hand, are marked up
with XML tags. The XML document is embedded within the HTML document.
88 XML includes data-management capabilities that HTML cannot provide. To better
understand the strengths of XML and weaknesses of HTML in data-management tasks,
consider the simple example of a Web page that includes a list of countries and some
basic facts about each country. A Web designer might decide to use HTML tags to show
each fact the same way for each country. Each fact would use a different tag. Assume that
the Web designer in this case decided to use the HTML heading tags to present the data.
Figure 2-10 shows the data and the HTML heading tags for four countries (this is only an
example; the actual list would include more than 150 countries). The first item in the list
provides the definitions for each tag. Figure 2-11 (on the next page) shows this HTML
document as it appears in a Web browser.
<html>
<head>
<title>Countries</title>
</head>
<body>
<h1>Countries</h1>
<h2>CountryName</h2>
<h3>CapitalCity</h3>
<h4>AreaInSquareKilometers</h4>
<h5>OfficialLanguage</h5>
<h6>VotingAge</h6>
<h2>Argentina</h2>
<h3>Buenos Aires</h3>
<h4>2,766,890</h4>
<h5>Spanish</h5>
<h6>18</h6>
<h2>Austria</h2>
<h3>Vienna</h3>
<h4>83,858</h4>
<h5>German</h5>
<h6>19</h6>
<h2>Barbados</h2>
<h3>Bridgetown</h3>
<h4>430</h4>
<h5>English</h5>
<h6>18</h6>
<h2>Belarus</h2>
<h3>Minsk</h3> Learning
<h4>207,600</h4>
<h5>Byelorussian</h5>
<h6>18</h6> Cengage
</body>
2015
</html> ©
FIGURE 2-10 Country list data marked up with HTML tags
Copyright 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.