]> matita.cs.unibo.it Git - helm.git/commitdiff
Initial revision
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 31 Oct 2000 13:54:30 +0000 (13:54 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 31 Oct 2000 13:54:30 +0000 (13:54 +0000)
helm/configuration/local/etc/helm/configuration.dtd [new file with mode: 0644]
helm/configuration/local/etc/helm/configuration.xml [new file with mode: 0644]
helm/configuration/local/lib/helm/configuration.pl [new file with mode: 0644]

diff --git a/helm/configuration/local/etc/helm/configuration.dtd b/helm/configuration/local/etc/helm/configuration.dtd
new file mode 100644 (file)
index 0000000..2a2428d
--- /dev/null
@@ -0,0 +1,34 @@
+<?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;>
diff --git a/helm/configuration/local/etc/helm/configuration.xml b/helm/configuration/local/etc/helm/configuration.xml
new file mode 100644 (file)
index 0000000..0a007fc
--- /dev/null
@@ -0,0 +1,22 @@
+<?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"/>&amp;stylesheet1=rootcontent.xsl&amp;stylesheet2=content_to_html.xsl&amp;xmlfile=</html_link>
+ <getter_url>http://localhost:8081/getwithtypes?url=</getter_url>
+</configuration>
diff --git a/helm/configuration/local/lib/helm/configuration.pl b/helm/configuration/local/lib/helm/configuration.pl
new file mode 100644 (file)
index 0000000..deea890
--- /dev/null
@@ -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];
+}