http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12477
--- Comment #12 from David Cook <[email protected]> --- As for using DBIx::Class, it's literally this simple: <code> use Koha::Database; use XML::Simple; my $schema = Koha::Database->new()->schema(); my $SimpleXML = new XML::Simple; my $field_file = "../marc21_tag.xml"; my $canonical_field_structure = ''; if ( -e $field_file){ my $canonical_field_structure = $SimpleXML->XMLin($field_file, KeyAttr => []); foreach my $structure (@{$canonical_field_structure->{marc_tag_structure}}){ $schema->resultset("MarcTagStructure")->find_or_create($structure); } } </code> Of course, this is just an example. I'd prefer to use XML::LibXML rather than XML::Simple (especially as XML::Simple itself states that new code should avoid using XML::Simple), and set up the logical structure a bit differently, but yeah...that's it. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
