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

index 72725a0018d5ccd91a41848c1231f163e996016a..7c48eb6561b9a43434a36c4af72090f96ed6522a 100644 (file)
@@ -186,6 +186,8 @@ MLBGamesPlayedXML.dtd
 MLBGIDPXML.dtd
 .IP \[bu]
 MLBHitByPitchXML.dtd
+.IP \[bu]
+mlbhitsleadersxml.dtd
 .RE
 .P
 The GameInfo and SportInfo types do not have their own top-level
diff --git a/schema/mlbhitsleadersxml.dtd b/schema/mlbhitsleadersxml.dtd
new file mode 100644 (file)
index 0000000..bd7595d
--- /dev/null
@@ -0,0 +1,26 @@
+<!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 , hits , average , atbats )>\r
+\r
+<!ELEMENT rank  (#PCDATA )>\r
+\r
+<!ELEMENT name  (#PCDATA )>\r
+\r
+<!ELEMENT hits  (#PCDATA )>\r
+\r
+<!ELEMENT average  (#PCDATA )>\r
+\r
+<!ELEMENT atbats  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/schemagen/mlbhitsleadersxml/mlbhitsleadersxml.xml b/schemagen/mlbhitsleadersxml/mlbhitsleadersxml.xml
new file mode 100644 (file)
index 0000000..37f995d
--- /dev/null
@@ -0,0 +1,290 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Statistics 1.0/EN" "mlbhitsleadersxml.dtd">\r
+<message>\r
+<XML_File_ID>1702711</XML_File_ID>\r
+<heading>AAX%AL-HITS-LEADERS</heading>\r
+<category>Statistics</category>\r
+<sport>MLB</sport>\r
+<title>2001 AL Hits Leaders</title>\r
+<listing>\r
+<rank>1</rank>\r
+<name>Ichiro Suzuki, SEA</name>\r
+<hits>126</hits>\r
+<average>.349</average>\r
+<atbats>361</atbats>\r
+</listing>\r
+<listing>\r
+<rank>2</rank>\r
+<name>Shannon Stewart, TOR</name>\r
+<hits>109</hits>\r
+<average>.323</average>\r
+<atbats>337</atbats>\r
+</listing>\r
+<listing>\r
+<rank>3</rank>\r
+<name>Mike Sweeney, KC</name>\r
+<hits>106</hits>\r
+<average>.335</average>\r
+<atbats>316</atbats>\r
+</listing>\r
+<listing>\r
+<rank>4</rank>\r
+<name>Roberto Alomar, CLE</name>\r
+<hits>103</hits>\r
+<average>.354</average>\r
+<atbats>291</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bret Boone, SEA</name>\r
+<hits>103</hits>\r
+<average>.326</average>\r
+<atbats>316</atbats>\r
+</listing>\r
+<listing>\r
+<rank>6</rank>\r
+<name>Juan Gonzalez, CLE</name>\r
+<hits>101</hits>\r
+<average>.341</average>\r
+<atbats>296</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Manny Ramirez, BOS</name>\r
+<hits>101</hits>\r
+<average>.331</average>\r
+<atbats>305</atbats>\r
+</listing>\r
+<listing>\r
+<rank>8</rank>\r
+<name>Alex Rodriguez, TEX</name>\r
+<hits>100</hits>\r
+<average>.315</average>\r
+<atbats>317</atbats>\r
+</listing>\r
+<listing>\r
+<rank>9</rank>\r
+<name>Cristian Guzman, MIN</name>\r
+<hits>99</hits>\r
+<average>.306</average>\r
+<atbats>324</atbats>\r
+</listing>\r
+<listing>\r
+<rank>10</rank>\r
+<name>Garret Anderson, ANA</name>\r
+<hits>92</hits>\r
+<average>.273</average>\r
+<atbats>337</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Rey Sanchez, KC</name>\r
+<hits>92</hits>\r
+<average>.300</average>\r
+<atbats>307</atbats>\r
+</listing>\r
+<listing>\r
+<rank>12</rank>\r
+<name>Derek Jeter, NYY</name>\r
+<hits>91</hits>\r
+<average>.288</average>\r
+<atbats>316</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>John Olerud, SEA</name>\r
+<hits>91</hits>\r
+<average>.317</average>\r
+<atbats>287</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Darin Erstad, ANA</name>\r
+<hits>91</hits>\r
+<average>.283</average>\r
+<atbats>322</atbats>\r
+</listing>\r
+<listing>\r
+<rank>15</rank>\r
+<name>Fred McGriff, TB</name>\r
+<hits>90</hits>\r
+<average>.332</average>\r
+<atbats>271</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Jason Giambi, OAK</name>\r
+<hits>90</hits>\r
+<average>.337</average>\r
+<atbats>267</atbats>\r
+</listing>\r
+<listing>\r
+<rank>17</rank>\r
+<name>Raul Mondesi, TOR</name>\r
+<hits>89</hits>\r
+<average>.283</average>\r
+<atbats>315</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Doug Mientkiewicz, MIN</name>\r
+<hits>89</hits>\r
+<average>.312</average>\r
+<atbats>285</atbats>\r
+</listing>\r
+<listing>\r
+<rank>19</rank>\r
+<name>Magglio Ordonez, SOX</name>\r
+<hits>87</hits>\r
+<average>.304</average>\r
+<atbats>286</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Matt Lawton, MIN</name>\r
+<hits>87</hits>\r
+<average>.299</average>\r
+<atbats>291</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Terrence Long, OAK</name>\r
+<hits>87</hits>\r
+<average>.274</average>\r
+<atbats>317</atbats>\r
+</listing>\r
+<listing>\r
+<rank>22</rank>\r
+<name>Jermaine Dye, KC</name>\r
+<hits>85</hits>\r
+<average>.283</average>\r
+<atbats>300</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Miguel Tejada, OAK</name>\r
+<hits>85</hits>\r
+<average>.268</average>\r
+<atbats>317</atbats>\r
+</listing>\r
+<listing>\r
+<rank>24</rank>\r
+<name>Carlos Beltran, KC</name>\r
+<hits>83</hits>\r
+<average>.266</average>\r
+<atbats>312</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alex Gonzalez, TOR</name>\r
+<hits>83</hits>\r
+<average>.257</average>\r
+<atbats>323</atbats>\r
+</listing>\r
+<listing>\r
+<rank>26</rank>\r
+<name>David Eckstein, ANA</name>\r
+<hits>82</hits>\r
+<average>.283</average>\r
+<atbats>290</atbats>\r
+</listing>\r
+<listing>\r
+<rank>27</rank>\r
+<name>Carlos Lee, SOX</name>\r
+<hits>81</hits>\r
+<average>.302</average>\r
+<atbats>268</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Edgar Martinez, SEA</name>\r
+<hits>81</hits>\r
+<average>.303</average>\r
+<atbats>267</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Scott Brosius, NYY</name>\r
+<hits>81</hits>\r
+<average>.290</average>\r
+<atbats>279</atbats>\r
+</listing>\r
+<listing>\r
+<rank>30</rank>\r
+<name>Carl Everett, BOS</name>\r
+<hits>80</hits>\r
+<average>.284</average>\r
+<atbats>282</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Tino Martinez, NYY</name>\r
+<hits>80</hits>\r
+<average>.260</average>\r
+<atbats>308</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bernie Williams, NYY</name>\r
+<hits>80</hits>\r
+<average>.324</average>\r
+<atbats>247</atbats>\r
+</listing>\r
+<listing>\r
+<rank>33</rank>\r
+<name>Omar Vizquel, CLE</name>\r
+<hits>79</hits>\r
+<average>.262</average>\r
+<atbats>302</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alfonso Soriano, NYY</name>\r
+<hits>79</hits>\r
+<average>.272</average>\r
+<atbats>290</atbats>\r
+</listing>\r
+<listing>\r
+<rank>35</rank>\r
+<name>Jose Offerman, BOS</name>\r
+<hits>78</hits>\r
+<average>.270</average>\r
+<atbats>289</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Brad Fullmer, TOR</name>\r
+<hits>78</hits>\r
+<average>.265</average>\r
+<atbats>294</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Rafael Palmeiro, TEX</name>\r
+<hits>78</hits>\r
+<average>.262</average>\r
+<atbats>298</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Damion Easley, DET</name>\r
+<hits>78</hits>\r
+<average>.285</average>\r
+<atbats>274</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Paul O`Neill, NYY</name>\r
+<hits>78</hits>\r
+<average>.260</average>\r
+<atbats>300</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Joe Randa, KC</name>\r
+<hits>78</hits>\r
+<average>.256</average>\r
+<atbats>305</atbats>\r
+</listing>\r
+<time_stamp> July 3, 2001, at 12:37 PM ET </time_stamp>\r
+</message>\r
index 019679562eac775fcc9b027137ed55775f276042..9fda564eb0f137b05daae541ea91cd11d0d66dbf 100644 (file)
@@ -110,7 +110,7 @@ dtds =
     "MLBGamesPlayedXML.dtd",
     "MLBGIDPXML.dtd",
     "MLBHitByPitchXML.dtd",
-    "mlbhitsleadersxml.dtd", -- no dtd
+    "mlbhitsleadersxml.dtd",
     "mlbhomerunsxml.dtd", -- no dtd
     "MLBHRFreqXML.dtd", -- no dtd
     "MLBIntWalksXML.dtd", -- no dtd
@@ -354,7 +354,8 @@ sport_info_test_files =
     "mlbdoublesleadersxml.xml",
     "MLBGamesPlayedXML.xml",
     "MLBGIDPXML.xml",
-    "MLBHitByPitchXML.xml"
+    "MLBHitByPitchXML.xml",
+    "mlbhitsleadersxml.xml"
   ]
 
 
diff --git a/test/xml/sportinfo/mlbhitsleadersxml.dtd b/test/xml/sportinfo/mlbhitsleadersxml.dtd
new file mode 100644 (file)
index 0000000..bd7595d
--- /dev/null
@@ -0,0 +1,26 @@
+<!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 , hits , average , atbats )>\r
+\r
+<!ELEMENT rank  (#PCDATA )>\r
+\r
+<!ELEMENT name  (#PCDATA )>\r
+\r
+<!ELEMENT hits  (#PCDATA )>\r
+\r
+<!ELEMENT average  (#PCDATA )>\r
+\r
+<!ELEMENT atbats  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/test/xml/sportinfo/mlbhitsleadersxml.xml b/test/xml/sportinfo/mlbhitsleadersxml.xml
new file mode 100644 (file)
index 0000000..37f995d
--- /dev/null
@@ -0,0 +1,290 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Statistics 1.0/EN" "mlbhitsleadersxml.dtd">\r
+<message>\r
+<XML_File_ID>1702711</XML_File_ID>\r
+<heading>AAX%AL-HITS-LEADERS</heading>\r
+<category>Statistics</category>\r
+<sport>MLB</sport>\r
+<title>2001 AL Hits Leaders</title>\r
+<listing>\r
+<rank>1</rank>\r
+<name>Ichiro Suzuki, SEA</name>\r
+<hits>126</hits>\r
+<average>.349</average>\r
+<atbats>361</atbats>\r
+</listing>\r
+<listing>\r
+<rank>2</rank>\r
+<name>Shannon Stewart, TOR</name>\r
+<hits>109</hits>\r
+<average>.323</average>\r
+<atbats>337</atbats>\r
+</listing>\r
+<listing>\r
+<rank>3</rank>\r
+<name>Mike Sweeney, KC</name>\r
+<hits>106</hits>\r
+<average>.335</average>\r
+<atbats>316</atbats>\r
+</listing>\r
+<listing>\r
+<rank>4</rank>\r
+<name>Roberto Alomar, CLE</name>\r
+<hits>103</hits>\r
+<average>.354</average>\r
+<atbats>291</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bret Boone, SEA</name>\r
+<hits>103</hits>\r
+<average>.326</average>\r
+<atbats>316</atbats>\r
+</listing>\r
+<listing>\r
+<rank>6</rank>\r
+<name>Juan Gonzalez, CLE</name>\r
+<hits>101</hits>\r
+<average>.341</average>\r
+<atbats>296</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Manny Ramirez, BOS</name>\r
+<hits>101</hits>\r
+<average>.331</average>\r
+<atbats>305</atbats>\r
+</listing>\r
+<listing>\r
+<rank>8</rank>\r
+<name>Alex Rodriguez, TEX</name>\r
+<hits>100</hits>\r
+<average>.315</average>\r
+<atbats>317</atbats>\r
+</listing>\r
+<listing>\r
+<rank>9</rank>\r
+<name>Cristian Guzman, MIN</name>\r
+<hits>99</hits>\r
+<average>.306</average>\r
+<atbats>324</atbats>\r
+</listing>\r
+<listing>\r
+<rank>10</rank>\r
+<name>Garret Anderson, ANA</name>\r
+<hits>92</hits>\r
+<average>.273</average>\r
+<atbats>337</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Rey Sanchez, KC</name>\r
+<hits>92</hits>\r
+<average>.300</average>\r
+<atbats>307</atbats>\r
+</listing>\r
+<listing>\r
+<rank>12</rank>\r
+<name>Derek Jeter, NYY</name>\r
+<hits>91</hits>\r
+<average>.288</average>\r
+<atbats>316</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>John Olerud, SEA</name>\r
+<hits>91</hits>\r
+<average>.317</average>\r
+<atbats>287</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Darin Erstad, ANA</name>\r
+<hits>91</hits>\r
+<average>.283</average>\r
+<atbats>322</atbats>\r
+</listing>\r
+<listing>\r
+<rank>15</rank>\r
+<name>Fred McGriff, TB</name>\r
+<hits>90</hits>\r
+<average>.332</average>\r
+<atbats>271</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Jason Giambi, OAK</name>\r
+<hits>90</hits>\r
+<average>.337</average>\r
+<atbats>267</atbats>\r
+</listing>\r
+<listing>\r
+<rank>17</rank>\r
+<name>Raul Mondesi, TOR</name>\r
+<hits>89</hits>\r
+<average>.283</average>\r
+<atbats>315</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Doug Mientkiewicz, MIN</name>\r
+<hits>89</hits>\r
+<average>.312</average>\r
+<atbats>285</atbats>\r
+</listing>\r
+<listing>\r
+<rank>19</rank>\r
+<name>Magglio Ordonez, SOX</name>\r
+<hits>87</hits>\r
+<average>.304</average>\r
+<atbats>286</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Matt Lawton, MIN</name>\r
+<hits>87</hits>\r
+<average>.299</average>\r
+<atbats>291</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Terrence Long, OAK</name>\r
+<hits>87</hits>\r
+<average>.274</average>\r
+<atbats>317</atbats>\r
+</listing>\r
+<listing>\r
+<rank>22</rank>\r
+<name>Jermaine Dye, KC</name>\r
+<hits>85</hits>\r
+<average>.283</average>\r
+<atbats>300</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Miguel Tejada, OAK</name>\r
+<hits>85</hits>\r
+<average>.268</average>\r
+<atbats>317</atbats>\r
+</listing>\r
+<listing>\r
+<rank>24</rank>\r
+<name>Carlos Beltran, KC</name>\r
+<hits>83</hits>\r
+<average>.266</average>\r
+<atbats>312</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alex Gonzalez, TOR</name>\r
+<hits>83</hits>\r
+<average>.257</average>\r
+<atbats>323</atbats>\r
+</listing>\r
+<listing>\r
+<rank>26</rank>\r
+<name>David Eckstein, ANA</name>\r
+<hits>82</hits>\r
+<average>.283</average>\r
+<atbats>290</atbats>\r
+</listing>\r
+<listing>\r
+<rank>27</rank>\r
+<name>Carlos Lee, SOX</name>\r
+<hits>81</hits>\r
+<average>.302</average>\r
+<atbats>268</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Edgar Martinez, SEA</name>\r
+<hits>81</hits>\r
+<average>.303</average>\r
+<atbats>267</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Scott Brosius, NYY</name>\r
+<hits>81</hits>\r
+<average>.290</average>\r
+<atbats>279</atbats>\r
+</listing>\r
+<listing>\r
+<rank>30</rank>\r
+<name>Carl Everett, BOS</name>\r
+<hits>80</hits>\r
+<average>.284</average>\r
+<atbats>282</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Tino Martinez, NYY</name>\r
+<hits>80</hits>\r
+<average>.260</average>\r
+<atbats>308</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bernie Williams, NYY</name>\r
+<hits>80</hits>\r
+<average>.324</average>\r
+<atbats>247</atbats>\r
+</listing>\r
+<listing>\r
+<rank>33</rank>\r
+<name>Omar Vizquel, CLE</name>\r
+<hits>79</hits>\r
+<average>.262</average>\r
+<atbats>302</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alfonso Soriano, NYY</name>\r
+<hits>79</hits>\r
+<average>.272</average>\r
+<atbats>290</atbats>\r
+</listing>\r
+<listing>\r
+<rank>35</rank>\r
+<name>Jose Offerman, BOS</name>\r
+<hits>78</hits>\r
+<average>.270</average>\r
+<atbats>289</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Brad Fullmer, TOR</name>\r
+<hits>78</hits>\r
+<average>.265</average>\r
+<atbats>294</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Rafael Palmeiro, TEX</name>\r
+<hits>78</hits>\r
+<average>.262</average>\r
+<atbats>298</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Damion Easley, DET</name>\r
+<hits>78</hits>\r
+<average>.285</average>\r
+<atbats>274</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Paul O`Neill, NYY</name>\r
+<hits>78</hits>\r
+<average>.260</average>\r
+<atbats>300</atbats>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Joe Randa, KC</name>\r
+<hits>78</hits>\r
+<average>.256</average>\r
+<atbats>305</atbats>\r
+</listing>\r
+<time_stamp> July 3, 2001, at 12:37 PM ET </time_stamp>\r
+</message>\r