use master branch again for osrf/eg install
[sitka/sitka-tools.git] / deployment / parse-osrf-xml.pl
CommitLineData
0155bbac
JD
1#!/usr/bin/perl
2use XML::LibXML;
3use Data::Dumper;
4
5# load the XML file
6my $filename = shift;
7open my $fh, '<', $filename;
8binmode $fh; # drop all PerlIO layers possibly created by a use open pragma
9my $doc = XML::LibXML->load_xml(IO => $fh);
10
11# get the values we want
12my $xpath_prefix = '/opensrf/default/apps/open-ils.storage/app_settings/databases/database';
13my %config;
14for my $attr ( qw/host port user db pw/ ) {
15 $config{$attr} = $doc->findvalue("$xpath_prefix/$attr");
16 #print $doc->findvalue("$xpath_prefix/$attr") . "\n";
17}
714254d7 18for my $k ( qw/host port user db pw/ ) {
0155bbac
JD
19 print "$k: " . $config{$k} . "\n";
20}