Created
October 26, 2011 19:35
-
-
Save krisbulman/1317537 to your computer and use it in GitHub Desktop.
This is a DBIx-XML-DataLoader-1.1b map file to map the elections pei xml feed to PostgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<XMLtoDB> | |
<dbinfo dbuser="postgres" dbpass="password" dbsource="dbi:Pg:dbname=peivotes;host=localhost;port=5432" name="peivotesca"/> | |
<RootElement name="rss"/> | |
<DocKeyColumn name="guid"/> | |
<Table name="Candidates" dbname="peivotes" xpath="./channel/item/electionspei:ballotcount"> | |
<KeyColumn name="GID" order="1"/> | |
<KeyColumn name="Poll" order="2"/> | |
<KeyColumn name="Dist_no" order="3"/> | |
<KeyColumn name="Party" order="4"/> | |
<Element xpath="../electionspei:pollname" toColumn="Pollname"/> | |
<Element xpath="../electionspei:poll" toColumn="Poll"/> | |
<Element xpath="../electionspei:districtname" toColumn="Dist_name"/> | |
<Element xpath="../electionspei:districtnumber" toColumn="Dist_no"/> | |
<Element xpath="./@party" toColumn="Party" /> | |
<Element xpath="./@lastname" toColumn="Last_Name" /> | |
<Element xpath="./@firstname" toColumn="First_Name" /> | |
<Element xpath="./@pollvotes" toColumn="Pollvotes" /> | |
<Element xpath="./@totalvotes" toColumn="Totalvotes" /> | |
</Table> | |
</XMLtoDB> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this map file expects a database called peivotesca, that has a table called candidates with the following columns:
gid
poll
dist_no
party
last_name
first_name
pollvotes
totalvotes