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

index dc1c1f04e0dcfa26a9b39d0170de207511de3f17..15be458f7980d46cae794ae91e5adfcde6dc98b6 100644 (file)
@@ -216,6 +216,8 @@ MLBSBSuccessXML.dtd
 mlbsluggingpctxml.dtd
 .IP \[bu]
 mlbstandxml.dtd
+.IP \[bu]
+mlbstandxml_preseason.dtd
 .RE
 .P
 The GameInfo and SportInfo types do not have their own top-level
diff --git a/schema/mlbstandxml_preseason.dtd b/schema/mlbstandxml_preseason.dtd
new file mode 100644 (file)
index 0000000..c39594d
--- /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  (Team , Win , Loss , Tie , Percentage )>\r
+\r
+<!ELEMENT Team  (#PCDATA )>\r
+\r
+<!ELEMENT Win  (#PCDATA )>\r
+\r
+<!ELEMENT Loss  (#PCDATA )>\r
+\r
+<!ELEMENT Tie  (#PCDATA )>\r
+\r
+<!ELEMENT Percentage  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/schemagen/mlbstandxml_preseason/mlbstandxml_preseason.xml b/schemagen/mlbstandxml_preseason/mlbstandxml_preseason.xml
new file mode 100644 (file)
index 0000000..f3275b2
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Standings 1.0/EN" "mlbstandxml_preseason.dtd">\r
+<message>\r
+<XML_File_ID>236536</XML_File_ID>\r
+<heading>AAL!CACTUS-STAND</heading>\r
+<category>Standings</category>\r
+<sport>MLB</sport>\r
+<title>2004 MLB - Cactus League Standings</title>\r
+<Listing>\r
+<Team>Milwaukee</Team>\r
+<Win>7</Win>\r
+<Loss>1</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.875</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Anaheim</Team>\r
+<Win>5</Win>\r
+<Loss>2</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.714</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Arizona</Team>\r
+<Win>4</Win>\r
+<Loss>2</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.667</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Kansas City</Team>\r
+<Win>4</Win>\r
+<Loss>3</Loss>\r
+<Tie>1</Tie>\r
+<Percentage>.563</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Chicago Cubs</Team>\r
+<Win>4</Win>\r
+<Loss>3</Loss>\r
+<Tie>2</Tie>\r
+<Percentage>.556</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Chicago White Sox</Team>\r
+<Win>4</Win>\r
+<Loss>4</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.500</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Texas</Team>\r
+<Win>4</Win>\r
+<Loss>4</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.500</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Seattle</Team>\r
+<Win>3</Win>\r
+<Loss>3</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.500</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Colorado</Team>\r
+<Win>3</Win>\r
+<Loss>4</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.429</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Oakland</Team>\r
+<Win>3</Win>\r
+<Loss>5</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.375</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>San Diego</Team>\r
+<Win>1</Win>\r
+<Loss>6</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.143</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>San Francisco</Team>\r
+<Win>1</Win>\r
+<Loss>6</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.143</Percentage>\r
+</Listing>\r
+<time_stamp> March 11, 2004, at 03:22 PM ET </time_stamp>\r
+</message>\r
index 06795a95a3e350fdac55b7f7f870694d86c376de..9e27c51bd78e195c9766081a239b5b2a62574404 100644 (file)
@@ -125,7 +125,7 @@ dtds =
     "MLBSBSuccessXML.dtd",
     "mlbsluggingpctxml.dtd",
     "mlbstandxml.dtd",
-    "mlbstandxml_preseason.dtd", -- no dtd
+    "mlbstandxml_preseason.dtd",
     "mlbstolenbasexml.dtd", -- no dtd
     "mlbtotalbasesleadersxml.dtd", -- no dtd
     "mlbtriplesleadersxml.dtd", -- no dtd
@@ -369,7 +369,8 @@ sport_info_test_files =
     "MLBSacrificesXML.xml",
     "MLBSBSuccessXML.xml",
     "mlbsluggingpctxml.xml",
-    "mlbstandxml.xml"
+    "mlbstandxml.xml",
+    "mlbstandxml_preseason.xml"
   ]
 
 
diff --git a/test/xml/sportinfo/mlbstandxml_preseason.dtd b/test/xml/sportinfo/mlbstandxml_preseason.dtd
new file mode 100644 (file)
index 0000000..c39594d
--- /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  (Team , Win , Loss , Tie , Percentage )>\r
+\r
+<!ELEMENT Team  (#PCDATA )>\r
+\r
+<!ELEMENT Win  (#PCDATA )>\r
+\r
+<!ELEMENT Loss  (#PCDATA )>\r
+\r
+<!ELEMENT Tie  (#PCDATA )>\r
+\r
+<!ELEMENT Percentage  (#PCDATA )>\r
+\r
+<!ELEMENT time_stamp  (#PCDATA )>\r
+\r
diff --git a/test/xml/sportinfo/mlbstandxml_preseason.xml b/test/xml/sportinfo/mlbstandxml_preseason.xml
new file mode 100644 (file)
index 0000000..f3275b2
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" standalone="no" ?>\r
+<!DOCTYPE message PUBLIC "-//TSN//DTD Standings 1.0/EN" "mlbstandxml_preseason.dtd">\r
+<message>\r
+<XML_File_ID>236536</XML_File_ID>\r
+<heading>AAL!CACTUS-STAND</heading>\r
+<category>Standings</category>\r
+<sport>MLB</sport>\r
+<title>2004 MLB - Cactus League Standings</title>\r
+<Listing>\r
+<Team>Milwaukee</Team>\r
+<Win>7</Win>\r
+<Loss>1</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.875</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Anaheim</Team>\r
+<Win>5</Win>\r
+<Loss>2</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.714</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Arizona</Team>\r
+<Win>4</Win>\r
+<Loss>2</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.667</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Kansas City</Team>\r
+<Win>4</Win>\r
+<Loss>3</Loss>\r
+<Tie>1</Tie>\r
+<Percentage>.563</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Chicago Cubs</Team>\r
+<Win>4</Win>\r
+<Loss>3</Loss>\r
+<Tie>2</Tie>\r
+<Percentage>.556</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Chicago White Sox</Team>\r
+<Win>4</Win>\r
+<Loss>4</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.500</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Texas</Team>\r
+<Win>4</Win>\r
+<Loss>4</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.500</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Seattle</Team>\r
+<Win>3</Win>\r
+<Loss>3</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.500</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Colorado</Team>\r
+<Win>3</Win>\r
+<Loss>4</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.429</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>Oakland</Team>\r
+<Win>3</Win>\r
+<Loss>5</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.375</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>San Diego</Team>\r
+<Win>1</Win>\r
+<Loss>6</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.143</Percentage>\r
+</Listing>\r
+<Listing>\r
+<Team>San Francisco</Team>\r
+<Win>1</Win>\r
+<Loss>6</Loss>\r
+<Tie>0</Tie>\r
+<Percentage>.143</Percentage>\r
+</Listing>\r
+<time_stamp> March 11, 2004, at 03:22 PM ET </time_stamp>\r
+</message>\r