#!/usr/bin/env perl

use strict;
use CGI qw(standard);

my $q = new CGI;

my $fileName = "/usr/local/websites/asylum/htdocs/htdocs/rdfcal/list.xml";
my @conv = (
    [ "/usr/local/websites/asylum/htdocs/htdocs/rdfcal/makeHTML.xsl",
      "/usr/local/websites/asylum/htdocs/htdocs/rdfcal/cal.html" ],
    [ "/usr/local/websites/asylum/htdocs/htdocs/rdfcal/makeICS.xsl",
      "/usr/local/websites/asylum/htdocs/htdocs/rdfcal/cal.ics" ],
    [ "/usr/local/websites/asylum/htdocs/htdocs/rdfcal/makeRSS.xsl",
      "/usr/local/websites/asylum/htdocs/htdocs/rdfcal/cal_rss.rdf" ],
);

foreach my $arrp (@conv) {
    my $cmd = "xsltproc $arrp->[0] $fileName > $arrp->[1]";
    my $out = `$cmd`;
    die "Failed to create the HTML file\n$out\n$!" if $?;
}

print "Status: 302 Moved\nLocation: /rdfcal/cal.html\n\n";

