|
|
Baseball |
A project by Clint Wrede |
||
|
|
For me, baseball has never been "just a game." Instead, I see it as equal parts sport and art. It's intensely psychological, with each game a continuous series of situational confrontations, each drawn from a seemingly endless range of permutations. Even the rules are finely tuned to provide an even balance between batter and pitcher, offense and defense, scoring and being scored upon.
Statistics have always been part of the game as well. Fans--and opposing players--want to know who hits the most home runs, steals the most bases, strikes out the most batters.... Since the early years of the game's national popularity, the boxscore has been the primary way off communicating a summary of what occurred in a single game. Boxscores became, and still are, staples of newspaper reading for millions of Americans. With this project, I've attempted to harness the boxscore in XML and explore how that information might be manipulated.
|
|
|
|
I began by writing a DTD for a typical newspaper boxscore. The main difficulty here, aside from the sheer volume of information contained (and elements needed) was combining information about batters and pitchers from the "table" portions of the box with the "paragraph" portions, since both were giving similar data but in very different formats. The tables have a row for each player, showing the quantity of particular statistics for each player (at-bats, runs, etc.), even if the quantity is zero. The paragraph, on the other hand, lists, by statistic, only the players who achieved it, if any, along with the corresponding quantity. This combination was accomplished by effectively moving the paragraph data into the table.
Next came the tagging of two documents, both boxscores of recent games of the Chicago White Sox ("my team" since boyhood), from April 23 and May 3, 2000.
|
|
The major task now was to present the tagged data as much like a typical newspaper boxscore as possible. CSS's inability to rearrange data made this an XSL task, prompting this XSL stylesheet. The resulting documents (April 23 XML document and May 3 XML document) are close to "regulation" boxscores, with some confounding differences I was unable to overcome, such as treating the last element in a series differently than others (placing a period instead of a comma at the end of a list, for instance) and stray spaces I couldn't get rid of.
Many fans would think of a linescore as a minimalist version of a boxscore. My other XSL stylesheet uses this entity-calling XML document to create this display the date and linescore for each of the boxscore entities it calls, along with a link to an article about the game. However, this could be used to display an entire season's scores for a league or a team, or perhaps the scores for a particular date range.
The reshuffling of data from my original documents made CSS perhaps the most frustrating part of the project. CSS seems designed to format XML documents only if they have had tags added and no other modifications made, such as my information rearrangement and subsequent loss of original spacing. What I ended up with was a rather simple CSS stylesheet, presenting the date and linescore for the game, here.
Many thanks are due Prof. Srinivasan, Mira Dougherty-Johnson, and Michelle Holschuh Simmons for their assistance and inspiration in this project, and for putting up with my whining.
|
|
|
|
|
Babe Ruth & Lou Gehrig celebrate the completion of their XML project. |
A dejected Ozzie Guillen, upon learning that Internet Explorer 5 may not support all features of the XSL spec. |