3236-7 ch04.F.
qc
6/29/99
1:04 PM
Page 59
C H A P T E R
Structuring Data
n this chapter, we will develop a longer example that shows
how a large list of baseball statistics and other similar data
might be stored in XML. A document like this has several
potential uses. Most obviously it can be displayed on a Web
page. It can also be used as input to other programs that want
to analyze particular seasons or lineup. Along the way, youll
learn, among other things, how to mark up the data in XML,
why XML tags are chosen, and how to prepare a CSS style
sheet for a document.
Examining the Data
As I write this (October, 1998), the New York Yankees have just
won their 24th World Series by sweeping the San Diego Padres
in four games. The Yankees finished the regular season with
an American League record 114 wins. Overall, 1998 was an
astonishing season. The St. Louis Cardinals Mark McGwire
and the Chicago Cubs Sammy Sosa dueled through September
for the record, previously held by Roger Maris, for most home
runs hit in a single season since baseball was integrated. (The
all-time major league record for home runs in a single season
is still held by catcher Josh Gibson who hit 75 home runs in
the Negro league in 1931. Admittedly, Gibson didnt have to
face the sort of pitching Sosa and McGwire faced in todays
integrated league. Then again neither did Babe Ruth who was
widely (and incorrectly) believed to have held the record until
Roger Maris hit 61 in 1961.)
What exactly made 1998 such an exciting season? A cynic
would tell you that 1998 was an expansion year with three
new teams, and consequently much weaker pitching overall.
This gave outstanding batters like Sosa and McGwire and
outstanding teams like the Yankees a chance to really shine
because, although they were as strong as theyd been in
1997, the average opponent they faced was a lot weaker. Of
course true baseball fanatics know the real reason, statistics.
In This Chapter
Examining the data
XMLizing the data
The advantages of
the XML format
Preparing a style
sheet for document
display