--- /dev/null
+<?xml encoding="ISO-8859-1"?>
+
+<!--*****************************************************************-->
+<!-- DTD FOR HELM CONFIGURATION FILE: -->
+<!-- First draft: June 6 2000, Claudio Sacerdoti Coen -->
+<!-- Last Revision: June 6 2000, Claudio Sacerdoti Coen -->
+<!--*****************************************************************-->
+
+<!ELEMENT configuration (helm_dir, dtd_dir, servers_file, uris_dbm, dest,
+ indexname, tmpdir, helm_url_path,
+ getheader_url, style_url, webeq_url, webeqp_url,
+ use_webeqp_url, html_link, getter_url)>
+
+<!ENTITY % expr '(#PCDATA | value-of)*'>
+
+<!ELEMENT value-of EMPTY>
+<!ATTLIST value-of
+ var NMTOKEN #REQUIRED >
+
+<!ELEMENT helm_dir %expr;>
+<!ELEMENT dtd_dir %expr;>
+<!ELEMENT servers_file %expr;>
+<!ELEMENT uris_dbm %expr;>
+<!ELEMENT dest %expr;>
+<!ELEMENT indexname %expr;>
+<!ELEMENT tmpdir %expr;>
+<!ELEMENT helm_url_path %expr;>
+<!ELEMENT getheader_url %expr;>
+<!ELEMENT style_url %expr;>
+<!ELEMENT webeq_url %expr;>
+<!ELEMENT webeqp_url %expr;>
+<!ELEMENT use_webeqp_url %expr;>
+<!ELEMENT html_link %expr;>
+<!ELEMENT getter_url %expr;>
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE configuration SYSTEM "configuration.dtd">
+
+<configuration>
+ <helm_dir>/home/pauillac/coq3/sacerdot/HELM/INTERFACE/examples</helm_dir>
+
+ <dtd_dir><value-of var="helm_dir"/>/dtd</dtd_dir>
+ <servers_file>/home/pauillac/coq3/sacerdot/HELM/INTERFACE/servers.txt</servers_file>
+ <uris_dbm>/home/pauillac/coq3/sacerdot/HELM/INTERFACE/urls_of_uris</uris_dbm>
+ <dest><value-of var="helm_dir"/></dest>
+ <indexname>index.txt</indexname>
+ <tmpdir>/tmp</tmpdir>
+
+ <helm_url_path>/home/lpadovan/helm/PARSER/examples</helm_url_path>
+ <getheader_url>http://localhost/really_very_local/helm/header/getheader.xml</getheader_url>
+ <style_url>http://localhost/really_very_local/helm/style/</style_url>
+ <webeq_url>http://localhost/cgi-bin/helm/webeq.pl</webeq_url>
+ <webeqp_url>http://localhost/cgi-bin/helm/webeqp.pl</webeqp_url>
+ <use_webeqp_url>http://localhost/cgi-bin/helm/use_webeqp.pl</use_webeqp_url>
+ <html_link><value-of var="getheader_url"/>?baseurl=<value-of var="style_url"/>&stylesheet1=rootcontent.xsl&stylesheet2=content_to_html.xsl&xmlfile=</html_link>
+ <getter_url>http://localhost:8081/getwithtypes?url=</getter_url>
+</configuration>
--- /dev/null
+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];
+}