openva / saberva

A parser for bulk campaign finance data files provided by the Virginia State Board of Elections.
MIT License
12 stars 2 forks source link

Recess single-element LiA and LiD elements #22

Closed waldoj closed 9 years ago

waldoj commented 9 years ago

We've almost got this problem fixed. The remaining problem is that this code:

$tmp = $report->ScheduleA->LiA;
$report->ScheduleA->LiA = array();
$report->ScheduleA->LiA[] = $tmp;

generates this error:

It is not yet possible to assign complex types to properties

I'm pretty confident that this is a SimpleXML error, since $report is a SimpleXML object. The solution is to stop trying to just append to that object, and instead use SimpleXML's own functionality (presumably addChild) to make this change to the data.