From 38e1ee1df7be76922343935255e26673af8c7682 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 31 Oct 2000 13:54:30 +0000 Subject: [PATCH 1/1] Initial revision --- .../local/etc/helm/configuration.dtd | 34 ++++++++++++++++++ .../local/etc/helm/configuration.xml | 22 ++++++++++++ .../local/lib/helm/configuration.pl | 35 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 helm/configuration/local/etc/helm/configuration.dtd create mode 100644 helm/configuration/local/etc/helm/configuration.xml create mode 100644 helm/configuration/local/lib/helm/configuration.pl diff --git a/helm/configuration/local/etc/helm/configuration.dtd b/helm/configuration/local/etc/helm/configuration.dtd new file mode 100644 index 000000000..2a2428d1d --- /dev/null +++ b/helm/configuration/local/etc/helm/configuration.dtd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/helm/configuration/local/etc/helm/configuration.xml b/helm/configuration/local/etc/helm/configuration.xml new file mode 100644 index 000000000..0a007fc5b --- /dev/null +++ b/helm/configuration/local/etc/helm/configuration.xml @@ -0,0 +1,22 @@ + + + + + /home/pauillac/coq3/sacerdot/HELM/INTERFACE/examples + + /dtd + /home/pauillac/coq3/sacerdot/HELM/INTERFACE/servers.txt + /home/pauillac/coq3/sacerdot/HELM/INTERFACE/urls_of_uris + + index.txt + /tmp + + /home/lpadovan/helm/PARSER/examples + http://localhost/really_very_local/helm/header/getheader.xml + http://localhost/really_very_local/helm/style/ + http://localhost/cgi-bin/helm/webeq.pl + http://localhost/cgi-bin/helm/webeqp.pl + http://localhost/cgi-bin/helm/use_webeqp.pl + ?baseurl=&stylesheet1=rootcontent.xsl&stylesheet2=content_to_html.xsl&xmlfile= + http://localhost:8081/getwithtypes?url= + diff --git a/helm/configuration/local/lib/helm/configuration.pl b/helm/configuration/local/lib/helm/configuration.pl new file mode 100644 index 000000000..deea890a8 --- /dev/null +++ b/helm/configuration/local/lib/helm/configuration.pl @@ -0,0 +1,35 @@ +use XML::Parser; + +# this should be the only fixed constant +$configuration_file = "/home/cadet/sacerdot/local/etc/helm/configuration.xml"; + +$parser = new XML::Parser(Handlers => {Start => \&handle_start, + End => \&handle_end, + Char => \&handle_char}); + + +$parser->parsefile($configuration_file, ErrorContext => 3); + + +sub handle_start +{ + if ($_[1] eq "value-of") { + $$varname .= ${$_[3]}; + } elsif ($_[1] ne "configuration") { + $varname = $_[1]; + } +} + +sub handle_end +{ + if ($_[1] ne "value-of" && $_[1] ne "configuration") { + # Next line for debugging only: + # print "OK: #$_[1]# := #$$varname#\n"; + $varname = undef; + } +} + +sub handle_char +{ + $$varname .= $_[1]; +} -- 2.39.2