Merge commit 'workbuffer.org-koha/translation' into to-push
[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 English;
11
12 use XML::Simple qw(:strict);
13 use Data::Dumper;
14
15 my $parser = new XML::Simple( KeyAttr   => { login => '+id',
16                                              institution => '+id',
17                                              service => '+port', },
18                               GroupTags =>  { listeners => 'service',
19                                               accounts => 'login',
20                                               institutions => 'institution', },
21                               ForceArray=> [ 'service',
22                                              'login',
23                                              'institution' ],
24                               ValueAttr =>  { 'error-detect' => 'enabled',
25                                              'min_servers' => 'value',
26                                              'max_servers' => 'value'} );
27
28 my $ref = $parser->XMLin(@ARGV ? shift : 'SIPconfig.xml');
29
30 print Dumper($ref);