]> git.evergreen-ils.org Git - working/SIPServer.git/blob - xmlparse.pl
Fix checksum generation so that it actually works with clients.
[working/SIPServer.git] / xmlparse.pl
1 #!/usr/bin/perl
2 #
3 # Copyright (C) 2006-2008  Georgia Public Library Service
4
5 # Author: David J. Fiander
6
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of version 2 of the GNU General Public
9 # License as published by the Free Software Foundation.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public
17 # License along with this program; if not, write to the Free
18 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 # MA 02111-1307 USA
20 #
21 # This file reads a SIPServer xml-format configuration file and dumps it
22 # to stdout.  Just to see what the structures look like.
23 #
24 # The 'new XML::Simple' option must agree exactly with the configuration
25 # in Sip::Configuration.pm
26 #
27 use strict;
28 use English;
29
30 use XML::Simple qw(:strict);
31 use Data::Dumper;
32
33 my $parser = new XML::Simple( KeyAttr   => { login => '+id',
34                                              institution => '+id',
35                                              service => '+port', },
36                               GroupTags =>  { listeners => 'service',
37                                               accounts => 'login',
38                                               institutions => 'institution', },
39                               ForceArray=> [ 'service',
40                                              'login',
41                                              'institution' ],
42                               ValueAttr =>  { 'error-detect' => 'enabled',
43                                              'min_servers' => 'value',
44                                              'max_servers' => 'value'} );
45
46 my $ref = $parser->XMLin($ARGV[0]);
47
48 $Data::Dumper::Indent = 1;
49 print Dumper($ref);