]> gitweb.michael.orlitzky.com - dead/htsn-import.git/commitdiff
Add SportInfo support for MLBHitByPitchXML.dtd.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Jun 2014 13:32:06 +0000 (09:32 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Jun 2014 13:32:06 +0000 (09:32 -0400)
doc/man1/htsn-import.1
schema/MLBHitByPitchXML.dtd [new file with mode: 0644]
schemagen/MLBHitByPitchXML/MLBHitByPitchXML.xml [new file with mode: 0644]
src/TSN/XML/SportInfo.hs
test/xml/sportinfo/MLBHitByPitchXML.dtd [new file with mode: 0644]
test/xml/sportinfo/MLBHitByPitchXML.xml [new file with mode: 0644]

index c6de8cf74194549cb948af0444b130b07be9d03c..72725a0018d5ccd91a41848c1231f163e996016a 100644 (file)
@@ -184,6 +184,8 @@ mlbdoublesleadersxml.dtd
 MLBGamesPlayedXML.dtd
 .IP \[bu]
 MLBGIDPXML.dtd
+.IP \[bu]
+MLBHitByPitchXML.dtd
 .RE
 .P
 The GameInfo and SportInfo types do not have their own top-level
diff --git a/schema/MLBHitByPitchXML.dtd b/schema/MLBHitByPitchXML.dtd
new file mode 100644 (file)
index 0000000..942a2d9
--- /dev/null
@@ -0,0 +1,24 @@
+<!ELEMENT message  (XML_File_ID, heading , category , sport , title , Listing+ , time_stamp )>\r
+\r
+<!ELEMENT XML_File_ID  (#PCDATA )>\r
+\r
+<!ELEMENT heading  (#PCDATA )>\r
+\r
+<!ELEMENT category  (#PCDATA )>\r
+\r
+<!ELEMENT sport  (#PCDATA )>\r
+\r
+<!ELEMENT title  (#PCDATA )>\r
+\r
+<!ELEMENT Listing  (Rank , Name , HitByPitch , AtBats )>\r
+\r
+<!ELEMENT Rank  (#PCDATA )>\r
+\r
+<!ELEMENT Name  (#PCDATA )>\r
+\r
+<!ELEMENT HitByPitch  (#PCDATA )>\r
+\r
+<!ELEMENT AtBats  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/schemagen/MLBHitByPitchXML/MLBHitByPitchXML.xml b/schemagen/MLBHitByPitchXML/MLBHitByPitchXML.xml
new file mode 100644 (file)
index 0000000..fcf53ea
--- /dev/null
@@ -0,0 +1,250 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Statistics 1.0/EN" "MLBHitByPitchXML.dtd">\r
+<message>\r
+<XML_File_ID>17</XML_File_ID>\r
+<heading>AAX%AL-HITBYPITCH-LEADERS</heading>\r
+<category>Statistics</category>\r
+<sport>MLB</sport>\r
+<title>2002 AL Hit By Pitch Leaders</title>\r
+<Listing>\r
+<Rank>1</Rank>\r
+<Name>David Eckstein, ANA</Name>\r
+<HitByPitch>9</HitByPitch>\r
+<AtBats>262</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Melvin Mora, BAL</Name>\r
+<HitByPitch>9</HitByPitch>\r
+<AtBats>261</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>3</Rank>\r
+<Name>Jason Giambi, NYY</Name>\r
+<HitByPitch>7</HitByPitch>\r
+<AtBats>279</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Nick Johnson, NYY</Name>\r
+<HitByPitch>7</HitByPitch>\r
+<AtBats>227</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Jeff Cirillo, SEA</Name>\r
+<HitByPitch>7</HitByPitch>\r
+<AtBats>248</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>6</Rank>\r
+<Name>Carlos Delgado, TOR</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>264</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Shea Hillenbrand, BOS</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>297</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Tony Batista, BAL</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>276</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Corey Koskie, MIN</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>222</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>10</Rank>\r
+<Name>Jim Thome, CLE</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>251</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ricky Gutierrez, CLE</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>226</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Brad Fullmer, ANA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>220</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Adam Kennedy, ANA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>223</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Doug Mientkiewicz, MIN</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>235</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>A.J. Pierzynski, MIN</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>216</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Desi Relaford, SEA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>151</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Mike Cameron, SEA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>261</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Alex Rodriguez, TEX</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>294</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Randy Velarde, OAK</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>97</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>20</Rank>\r
+<Name>Matt Lawton, CLE</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>266</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Shannon Stewart, TOR</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>244</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Omar Vizquel, CLE</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>275</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Rickey Henderson, BOS</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>111</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Alfonso Soriano, NYY</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>326</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Derek Jeter, NYY</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>319</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Rondell White, NYY</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>233</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Joe Randa, KC</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>234</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Carlos Febles, KC</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>209</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ray Durham, SOX</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>253</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Scott Hatteberg, OAK</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>236</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Miguel Tejada, OAK</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>316</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Randy Winn, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>295</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Steve Cox, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>278</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ben Grieve, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>247</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Chris Gomez, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>235</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Herbert Perry, TEX</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>182</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Brook Fordyce, BAL</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>72</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ramon Santiago, DET</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>130</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>39</Rank>\r
+<Name>Ellis Burks, CLE</Name>\r
+<HitByPitch>3</HitByPitch>\r
+<AtBats>246</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Tim Salmon, ANA</Name>\r
+<HitByPitch>3</HitByPitch>\r
+<AtBats>260</AtBats>\r
+</Listing>\r
+<time_stamp> June 27, 2002, at 11:51 AM ET </time_stamp>\r
+</message>\r
index 27817fbbe3713c5810fd812595cb456a1ee33290..019679562eac775fcc9b027137ed55775f276042 100644 (file)
@@ -109,7 +109,7 @@ dtds =
     "mlbdoublesleadersxml.dtd",
     "MLBGamesPlayedXML.dtd",
     "MLBGIDPXML.dtd",
-    "MLBHitByPitchXML.dtd", -- no dtd
+    "MLBHitByPitchXML.dtd",
     "mlbhitsleadersxml.dtd", -- no dtd
     "mlbhomerunsxml.dtd", -- no dtd
     "MLBHRFreqXML.dtd", -- no dtd
@@ -353,7 +353,8 @@ sport_info_test_files =
     "mlbbattingavgxml.xml",
     "mlbdoublesleadersxml.xml",
     "MLBGamesPlayedXML.xml",
-    "MLBGIDPXML.xml"
+    "MLBGIDPXML.xml",
+    "MLBHitByPitchXML.xml"
   ]
 
 
diff --git a/test/xml/sportinfo/MLBHitByPitchXML.dtd b/test/xml/sportinfo/MLBHitByPitchXML.dtd
new file mode 100644 (file)
index 0000000..942a2d9
--- /dev/null
@@ -0,0 +1,24 @@
+<!ELEMENT message  (XML_File_ID, heading , category , sport , title , Listing+ , time_stamp )>\r
+\r
+<!ELEMENT XML_File_ID  (#PCDATA )>\r
+\r
+<!ELEMENT heading  (#PCDATA )>\r
+\r
+<!ELEMENT category  (#PCDATA )>\r
+\r
+<!ELEMENT sport  (#PCDATA )>\r
+\r
+<!ELEMENT title  (#PCDATA )>\r
+\r
+<!ELEMENT Listing  (Rank , Name , HitByPitch , AtBats )>\r
+\r
+<!ELEMENT Rank  (#PCDATA )>\r
+\r
+<!ELEMENT Name  (#PCDATA )>\r
+\r
+<!ELEMENT HitByPitch  (#PCDATA )>\r
+\r
+<!ELEMENT AtBats  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/test/xml/sportinfo/MLBHitByPitchXML.xml b/test/xml/sportinfo/MLBHitByPitchXML.xml
new file mode 100644 (file)
index 0000000..cf85268
--- /dev/null
@@ -0,0 +1,250 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Statistics 1.0/EN" "MLBHitByPitchXML.dtd">\r
+<message>\r
+<XML_File_ID>884717</XML_File_ID>\r
+<heading>AAX%AL-HITBYPITCH-LEADERS</heading>\r
+<category>Statistics</category>\r
+<sport>MLB</sport>\r
+<title>2002 AL Hit By Pitch Leaders</title>\r
+<Listing>\r
+<Rank>1</Rank>\r
+<Name>David Eckstein, ANA</Name>\r
+<HitByPitch>9</HitByPitch>\r
+<AtBats>262</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Melvin Mora, BAL</Name>\r
+<HitByPitch>9</HitByPitch>\r
+<AtBats>261</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>3</Rank>\r
+<Name>Jason Giambi, NYY</Name>\r
+<HitByPitch>7</HitByPitch>\r
+<AtBats>279</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Nick Johnson, NYY</Name>\r
+<HitByPitch>7</HitByPitch>\r
+<AtBats>227</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Jeff Cirillo, SEA</Name>\r
+<HitByPitch>7</HitByPitch>\r
+<AtBats>248</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>6</Rank>\r
+<Name>Carlos Delgado, TOR</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>264</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Shea Hillenbrand, BOS</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>297</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Tony Batista, BAL</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>276</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Corey Koskie, MIN</Name>\r
+<HitByPitch>6</HitByPitch>\r
+<AtBats>222</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>10</Rank>\r
+<Name>Jim Thome, CLE</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>251</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ricky Gutierrez, CLE</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>226</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Brad Fullmer, ANA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>220</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Adam Kennedy, ANA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>223</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Doug Mientkiewicz, MIN</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>235</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>A.J. Pierzynski, MIN</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>216</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Desi Relaford, SEA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>151</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Mike Cameron, SEA</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>261</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Alex Rodriguez, TEX</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>294</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Randy Velarde, OAK</Name>\r
+<HitByPitch>5</HitByPitch>\r
+<AtBats>97</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>20</Rank>\r
+<Name>Matt Lawton, CLE</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>266</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Shannon Stewart, TOR</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>244</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Omar Vizquel, CLE</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>275</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Rickey Henderson, BOS</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>111</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Alfonso Soriano, NYY</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>326</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Derek Jeter, NYY</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>319</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Rondell White, NYY</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>233</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Joe Randa, KC</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>234</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Carlos Febles, KC</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>209</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ray Durham, SOX</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>253</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Scott Hatteberg, OAK</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>236</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Miguel Tejada, OAK</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>316</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Randy Winn, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>295</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Steve Cox, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>278</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ben Grieve, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>247</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Chris Gomez, TB</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>235</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Herbert Perry, TEX</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>182</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Brook Fordyce, BAL</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>72</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Ramon Santiago, DET</Name>\r
+<HitByPitch>4</HitByPitch>\r
+<AtBats>130</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank>39</Rank>\r
+<Name>Ellis Burks, CLE</Name>\r
+<HitByPitch>3</HitByPitch>\r
+<AtBats>246</AtBats>\r
+</Listing>\r
+<Listing>\r
+<Rank></Rank>\r
+<Name>Tim Salmon, ANA</Name>\r
+<HitByPitch>3</HitByPitch>\r
+<AtBats>260</AtBats>\r
+</Listing>\r
+<time_stamp> June 27, 2002, at 11:51 AM ET </time_stamp>\r
+</message>\r