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

index 15be458f7980d46cae794ae91e5adfcde6dc98b6..2bf8138167bafcfb72d7887b2a91a8ff06d82543 100644 (file)
@@ -218,6 +218,8 @@ mlbsluggingpctxml.dtd
 mlbstandxml.dtd
 .IP \[bu]
 mlbstandxml_preseason.dtd
+.IP \[bu]
+mlbstolenbasexml.dtd
 .RE
 .P
 The GameInfo and SportInfo types do not have their own top-level
diff --git a/schema/mlbstolenbasexml.dtd b/schema/mlbstolenbasexml.dtd
new file mode 100644 (file)
index 0000000..f9d5eea
--- /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 , stolen_base , caught_stealing )>\r
+\r
+<!ELEMENT rank  (#PCDATA )>\r
+\r
+<!ELEMENT name  (#PCDATA )>\r
+\r
+<!ELEMENT stolen_base  (#PCDATA )>\r
+\r
+<!ELEMENT caught_stealing  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/schemagen/mlbstolenbasexml/mlbstolenbasexml.xml b/schemagen/mlbstolenbasexml/mlbstolenbasexml.xml
new file mode 100644 (file)
index 0000000..e7259e8
--- /dev/null
@@ -0,0 +1,250 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Statistics 1.0/EN" "mlbstolenbasexml.dtd">\r
+<message>\r
+<XML_File_ID>1791314</XML_File_ID>\r
+<heading>AAX%AL-SB-LEADERS</heading>\r
+<category>Statistics</category>\r
+<sport>MLB</sport>\r
+<title>2001 AL Stolen Bases Leaders</title>\r
+<listing>\r
+<rank>1</rank>\r
+<name>Ichiro Suzuki, SEA</name>\r
+<stolen_base>27</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>2</rank>\r
+<name>Chuck Knoblauch, NYY</name>\r
+<stolen_base>25</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>3</rank>\r
+<name>Roger Cedeno, DET</name>\r
+<stolen_base>24</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>4</rank>\r
+<name>Mark McLemore, SEA</name>\r
+<stolen_base>23</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alfonso Soriano, NYY</name>\r
+<stolen_base>23</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>6</rank>\r
+<name>Derek Jeter, NYY</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Mike Cameron, SEA</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Matt Lawton, MIN</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>5</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Jerry Hairston, BAL</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>10</rank>\r
+<name>Cristian Guzman, MIN</name>\r
+<stolen_base>16</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>11</rank>\r
+<name>Jose Cruz, TOR</name>\r
+<stolen_base>15</stolen_base>\r
+<caught_stealing>0</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Raul Mondesi, TOR</name>\r
+<stolen_base>15</stolen_base>\r
+<caught_stealing>7</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>13</rank>\r
+<name>Luis Rivas, MIN</name>\r
+<stolen_base>14</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Johnny Damon, OAK</name>\r
+<stolen_base>14</stolen_base>\r
+<caught_stealing>7</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>15</rank>\r
+<name>Roberto Alomar, CLE</name>\r
+<stolen_base>13</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Shannon Stewart, TOR</name>\r
+<stolen_base>13</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Darin Erstad, ANA</name>\r
+<stolen_base>13</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>18</rank>\r
+<name>Carlos Lee, SOX</name>\r
+<stolen_base>12</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>19</rank>\r
+<name>Omar Vizquel, CLE</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>7</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Magglio Ordonez, SOX</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bobby Higginson, DET</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>5</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Corey Koskie, MIN</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Delino DeShields, BAL</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>24</rank>\r
+<name>Damian Rolls, TB</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Carlos Beltran, KC</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>0</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Ray Durham, SOX</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>5</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Gerald Williams, NYY</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>28</rank>\r
+<name>Jose Macias, DET</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Chris Singleton, SOX</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>8</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Mike Bordick, BAL</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bernie Williams, NYY</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>32</rank>\r
+<name>Mike Sweeney, KC</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Kenny Lofton, CLE</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>David Eckstein, ANA</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Brady Anderson, BAL</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Carl Everett, BOS</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Paul O`Neill, NYY</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Rey Sanchez, KC</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>39</rank>\r
+<name>Jermaine Dye, KC</name>\r
+<stolen_base>7</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alex Gonzalez, TOR</name>\r
+<stolen_base>7</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<time_stamp> July 3, 2001, at 12:38 PM ET </time_stamp>\r
+</message>\r
index 9e27c51bd78e195c9766081a239b5b2a62574404..2350ea5f0e238793cc938a9c774aae15d792568f 100644 (file)
@@ -126,7 +126,7 @@ dtds =
     "mlbsluggingpctxml.dtd",
     "mlbstandxml.dtd",
     "mlbstandxml_preseason.dtd",
-    "mlbstolenbasexml.dtd", -- no dtd
+    "mlbstolenbasexml.dtd",
     "mlbtotalbasesleadersxml.dtd", -- no dtd
     "mlbtriplesleadersxml.dtd", -- no dtd
     "MLBWalkRateXML.dtd", -- no dtd
@@ -370,7 +370,8 @@ sport_info_test_files =
     "MLBSBSuccessXML.xml",
     "mlbsluggingpctxml.xml",
     "mlbstandxml.xml",
-    "mlbstandxml_preseason.xml"
+    "mlbstandxml_preseason.xml",
+    "mlbstolenbasexml.xml"
   ]
 
 
diff --git a/test/xml/sportinfo/mlbstolenbasexml.dtd b/test/xml/sportinfo/mlbstolenbasexml.dtd
new file mode 100644 (file)
index 0000000..f9d5eea
--- /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 , stolen_base , caught_stealing )>\r
+\r
+<!ELEMENT rank  (#PCDATA )>\r
+\r
+<!ELEMENT name  (#PCDATA )>\r
+\r
+<!ELEMENT stolen_base  (#PCDATA )>\r
+\r
+<!ELEMENT caught_stealing  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/test/xml/sportinfo/mlbstolenbasexml.xml b/test/xml/sportinfo/mlbstolenbasexml.xml
new file mode 100644 (file)
index 0000000..e7259e8
--- /dev/null
@@ -0,0 +1,250 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Statistics 1.0/EN" "mlbstolenbasexml.dtd">\r
+<message>\r
+<XML_File_ID>1791314</XML_File_ID>\r
+<heading>AAX%AL-SB-LEADERS</heading>\r
+<category>Statistics</category>\r
+<sport>MLB</sport>\r
+<title>2001 AL Stolen Bases Leaders</title>\r
+<listing>\r
+<rank>1</rank>\r
+<name>Ichiro Suzuki, SEA</name>\r
+<stolen_base>27</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>2</rank>\r
+<name>Chuck Knoblauch, NYY</name>\r
+<stolen_base>25</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>3</rank>\r
+<name>Roger Cedeno, DET</name>\r
+<stolen_base>24</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>4</rank>\r
+<name>Mark McLemore, SEA</name>\r
+<stolen_base>23</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alfonso Soriano, NYY</name>\r
+<stolen_base>23</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>6</rank>\r
+<name>Derek Jeter, NYY</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Mike Cameron, SEA</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Matt Lawton, MIN</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>5</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Jerry Hairston, BAL</name>\r
+<stolen_base>17</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>10</rank>\r
+<name>Cristian Guzman, MIN</name>\r
+<stolen_base>16</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>11</rank>\r
+<name>Jose Cruz, TOR</name>\r
+<stolen_base>15</stolen_base>\r
+<caught_stealing>0</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Raul Mondesi, TOR</name>\r
+<stolen_base>15</stolen_base>\r
+<caught_stealing>7</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>13</rank>\r
+<name>Luis Rivas, MIN</name>\r
+<stolen_base>14</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Johnny Damon, OAK</name>\r
+<stolen_base>14</stolen_base>\r
+<caught_stealing>7</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>15</rank>\r
+<name>Roberto Alomar, CLE</name>\r
+<stolen_base>13</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Shannon Stewart, TOR</name>\r
+<stolen_base>13</stolen_base>\r
+<caught_stealing>6</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Darin Erstad, ANA</name>\r
+<stolen_base>13</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>18</rank>\r
+<name>Carlos Lee, SOX</name>\r
+<stolen_base>12</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>19</rank>\r
+<name>Omar Vizquel, CLE</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>7</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Magglio Ordonez, SOX</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bobby Higginson, DET</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>5</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Corey Koskie, MIN</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Delino DeShields, BAL</name>\r
+<stolen_base>11</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>24</rank>\r
+<name>Damian Rolls, TB</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Carlos Beltran, KC</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>0</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Ray Durham, SOX</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>5</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Gerald Williams, NYY</name>\r
+<stolen_base>10</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>28</rank>\r
+<name>Jose Macias, DET</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Chris Singleton, SOX</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>8</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Mike Bordick, BAL</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>3</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Bernie Williams, NYY</name>\r
+<stolen_base>9</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>32</rank>\r
+<name>Mike Sweeney, KC</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Kenny Lofton, CLE</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>David Eckstein, ANA</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Brady Anderson, BAL</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Carl Everett, BOS</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Paul O`Neill, NYY</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>2</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Rey Sanchez, KC</name>\r
+<stolen_base>8</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank>39</rank>\r
+<name>Jermaine Dye, KC</name>\r
+<stolen_base>7</stolen_base>\r
+<caught_stealing>1</caught_stealing>\r
+</listing>\r
+<listing>\r
+<rank></rank>\r
+<name>Alex Gonzalez, TOR</name>\r
+<stolen_base>7</stolen_base>\r
+<caught_stealing>4</caught_stealing>\r
+</listing>\r
+<time_stamp> July 3, 2001, at 12:38 PM ET </time_stamp>\r
+</message>\r