#!/usr/bin/perl
$tutorial_base = "html/tutorials/vulnerability";
$tutorial_cert = "html/tutorials/vulnerability/cert";
$tutorial_vts  = "html/tutorials/vulnerability/vts";
$tutorial_xml  = "$tutorial_vts/tutorials.xml";
(@base_dir)    = ("$tutorial_base", "$tutorial_cert");
open(VTS, ">$tutorial_xml");
for (@base_dir) {
print;
  $dir = $_;
  $ls  = `ls $dir`;
 (@base) = split(/\s+/, $ls);
  for (@base) {
    next if (! /\.html/);
    $class = $file = $_;
    $class =~ s/_/ /g;
    $class =~ s/\.html//;
    print "$class\n";
    print VTS "<TUTORIAL TITLE>$class</TUTORIAL TITLE>\n";
    print VTS "<TUTORIAL TEXT>\n";
    open (TEXT, "$dir/$file");
    while (<TEXT>) {
      print VTS;
    }
    print VTS "</TUTORIAL TEXT>\n";
  }
  close (TEXT);
}  
close (VTS);
