esmith Posted August 17, 2012 Posted August 17, 2012 I've been reading through the similar threads here, and trying to parse out the correct way to handle this data import, but I keep getting errors when trying to import the data, and I've tried most of the variations I could think of with no luck. Here's a sample of the actual XML data. (publicly available via Vote Smart for elected officials, nothing private) This XML file does not appear to have any style information associated with it. The document tree is shown below. <bio> <generalInfo>...</generalInfo> <candidate> <candidateId>16646</candidateId> <crpId/> <photo>http://static.votesmart.org/canphoto/16646.jpg</photo> <firstName>Wesley</firstName> <nickName>Wes</nickName> <middleName/> <preferredName>Wesley</preferredName> <lastName>Chesbro</lastName> <suffix/> <birthDate>08/20/1951</birthDate> <birthPlace>Glendale, CA</birthPlace> <pronunciation/> <gender>Male</gender> <family> <![CDATA[ Wife: Cindy; 2 Children: Alen, Collin ]]> </family> <homeCity>Arcata</homeCity> <homeState>CA</homeState> <education> <![CDATA[ BA, Organizational Behavior, University of San Francisco Attended, Natural Resources, California State University, Humboldt ]]> </education> <profession> <![CDATA[ Director, Arcata Community Recycling Center, 1971-1972 ]]> </profession> <political> <![CDATA[ Assembly Member, California State Assembly, District 1, 2008-present Senator, California State Senate, 1998-2006 Supervisor, Humboldt County, 1980-1990 Member, Arcata City Council, 1974-1980 ]]> </political> <religion>United Methodist</religion> <congMembership> <![CDATA[ Member, Pacific Fisheries Legislative Task Force, present Member, Western Legislative Forestry Task Force, present Member, Local Agency Formation Commission, 1982-1990 Member, California Senate Solid Waste Task Force, 1988-1989 Member, Solar Cal, Local Government Commission, 1981-1982 Member, Board of Directors, Humboldt Bay Housing Corporation Member, Board of Directors, Mental Health Services Oversight and Accountability Commission ]]> </congMembership> <orgMembership> <![CDATA[ Vice Chair, Western States Recycling Coalition, 1995-1997 Member, California Integrated Waste Management Board, 1990-1998, 2007-2008 Founding Member, California Integrated Waste Management Board, 1990-1998 Member, Board of Directors, County Supervisors Association of California, 1988-1990 Member, Humboldt County Child Welfare Advisory Board, 1986-1990 Member, Board of Directors, Redwood Natural History Association, 1986-1990 Member, Humboldt Health Planning Council, 1985-1990 Member, Juvenile Justice & Delinquency Prevention, Humboldt County, 1983-1990 Member, Humboldt Transit Authority Board, 1982-1990 Member, Redwood Empire Division, League of California Cities, 1978 Member, North Coast Environmental Center, 1971-1974 Member, Multiple Sclerosis Society Member, Board of Directors, Open Door Health Systems Member, United Methodist Church ]]> </orgMembership> <specialMsg> <![CDATA[ ]]> </specialMsg> </candidate> <office> <name>State Assembly</name> <parties>Democratic</parties> <title>Assembly Member</title> <shortTitle>AM</shortTitle> <name>State Assembly</name> <type>State Legislative</type> <status>active</status> <firstElect>11/04/2008</firstElect> <lastElect>11/02/2010</lastElect> <nextElect/> <termStart>12/01/2008</termStart> <termEnd/> <district>1</district> <districtId>21271</districtId> <stateId>CA</stateId> <committee> <committeeId>9886</committeeId> <committeeName>Budget</committeeName> </committee> <committee> <committeeId>9890</committeeId> <committeeName>Environmental Safety and Toxic Materials</committeeName> </committee> <committee> <committeeId>13129</committeeId> <committeeName>Fisheries and Aquaculture</committeeName> </committee> <committee> <committeeId>9891</committeeId> <committeeName>Governmental Organization</committeeName> </committee> <committee> <committeeId>416</committeeId> <committeeName>Natural Resources</committeeName> </committee> <committee> <committeeId>12363</committeeId> <committeeName>Wine</committeeName> </committee> </office> <election> <office>State Assembly</office> <officeType>State Legislative</officeType> <parties>Democratic</parties> <district>2</district> <districtId>21272</districtId> <stateId>CA</stateId> <status>Running</status> <ballotName>Wesley Chesbro</ballotName> </election> </bio> Users are designated with a candidateID. My .xsl file is attached. I also exported some sample data using FMP's XML export option to start with, and then tried to go from there. There's also an election table, and an office table in the above data, but if I can get the candidate table to work, I'm sure I can muddle through the rest. My understanding is FMP will only pull one tables data at a time anyway, although if I'm wrong there please feel free to inform me otherwise. I'm at my wits end. Any help would be greatly appreciated. CandidateBio6.txt
comment Posted August 17, 2012 Posted August 17, 2012 :rolleyes: This ain't no voodoo - you can't just make the stuff up. I have fixed the most obvious mistakes - there's probably some more cleaning up to do, but it's a start. candidate.xsl.zip
esmith Posted August 20, 2012 Author Posted August 20, 2012 Thank you, that worked! I can go from there. Sorry it was so ugly to begin with.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now