Merge remote-tracking branch 'kc/new/enh/bug_5917' into kcmaster
[koha.git] / C4 / SIP / xmlparse.pl
1 #!/usr/bin/perl
2 #
3 # This file reads a SIPServer xml-format configuration file and dumps it
4 # to stdout.  Just to see what the structures look like.
5 #
6 # The 'new XML::Simple' option must agree exactly with the configuration
7 # in Sip::Configuration.pm
8 #
9 use strict;
10 #use warnings; FIXME - Bug 2505
11 use English;
12
13 use XML::Simple qw(:strict);
14 use Data::Dumper;
15
16 my $parser = new XML::Simple( KeyAttr   => { login => '+id',
17                                              institution => '+id',
18                                              service => '+port', },
19                               GroupTags =>  { listeners => 'service',
20                                               accounts => 'login',
21                                               institutions => 'institution', },
22                               ForceArray=> [ 'service',
23                                              'login',
24                                              'institution' ],
25                               ValueAttr =>  { 'error-detect' => 'enabled',
26                                              'min_servers' => 'value',
27                                              'max_servers' => 'value'} );
28
29 my $ref = $parser->XMLin(@ARGV ? shift : 'SIPconfig.xml');
30
31 print Dumper($ref);