}
# now generate OUTPUT:
# output will be saved in $content
- if ($format eq "txt") {
+ if ($format eq "txt") { # TXT output
foreach $key (sort(keys %dirs)) {
$content .= "dir, " . $key . "\n";
}
foreach $key (sort(keys %objects)) {
$content .= "object, $key, " . $objects{$key} . "\n";
}
- } elsif ($format eq "xml") {
+ } elsif ($format eq "xml") { # XML output
+ $content .= '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n";
+ $content .= '<!DOCTYPE ls SYSTEM ';
+ $content .= '"http://localhost:8081/getdtd?uri=ls.dtd">' . "\n\n";
$content .= "<ls>\n";
foreach $key (sort(keys %dirs)) {
$content .= "\t<section>$key</section>\n";