#!/usr/bin/perl

@content=<STDIN>;
chomp @content;

@slide=();

print "<?xml version='1.0'?>\n";
print "<slides effect=\"slide top left, blend\"
        bgcolor=\"#000000\" fgcolor=\"#FFFFFF\" 
        face=\"../ttf/decker.ttf\" size=\"15\"
        bgimage=\"../img/bg.png\"
        bullet=\"../img/bullet.png\"
        screen_width=\"1024\" screen_height=\"768\">\n";

push(@content," 23");

foreach(@content) {
	s/\#.*//;
	s/&/&amp;/g;
	s/</&lt;/;
	s/>/&gt;/;
	# unterpunkt
	if(/^ \d/) {
		if(@slide) {
			print "<slide>\n";
			pop(@slide);
			print "<header size=\"20\">$topic</header>\n<text></text>\n";
			foreach(@slide) {
				if(/ \+ /) {
					s/\+//;
					print "<text></text>\n<listitem size=\"20\">$_</listitem>\n";
				}
				else {
					print "<text>$_</text>\n";
				}
			}
			print "</slide>\n\n";
		}
		@slide=();
		#push(@slide,$_);
		$topic=$_;
	}
	# ueberpunkt
	elsif (/^\d/) {
		#$topic=$_;
	}
	# normaler content
	else {
		push(@slide,$_);
	}
}

print "</slides>\n";