-# Message-XML-String
-# erzeugen
-###########################
-
-sub create_message_xml ($$$) {
- my ($xml, $msges, $num) = @_;
-
- my $msg = $msges -> [$num];
-
- my $message = $xml -> createElement ('Message');
- $message -> setAttribute ('id', 'm'.$msg -> {mid});
- $message -> setAttribute ('flag', 'deleted') if ($msg -> {deleted});
-
- # Header erzeugen
- my $header = $xml -> createElement ('Header');
-
- # alles inside of 'Header'
- my $author = $xml -> createElement ('Author');
- my $name = $xml -> createElement ('Name');
- $name -> addText (toUTF8($msg -> {name}));
-
- my $email = $xml -> createElement ('Email');
-
- my $category = $xml -> createElement ('Category');
- $category -> addText (toUTF8($msg -> {cat}));
-
- my $subject = $xml -> createElement ('Subject');
- $subject -> addText (toUTF8($msg -> {subject}));
-
- my $date = $xml -> createElement ('Date');
- $date -> setAttribute ('longSec', $msg -> {time});
-
- $author -> appendChild ($name);
- $author -> appendChild ($email);
- $header -> appendChild ($author);
- $header -> appendChild ($category);
- $header -> appendChild ($subject);
- $header -> appendChild ($date);
- $message -> appendChild ($header);
-
- if ($msg -> {kids}) {
- for (@{$msg -> {kids}}) {
- $message -> appendChild (&create_message_xml ($xml, $msges, $_));}}
-
- $message;
-}
-
-# ====================================================
-# XML-Parsen von Hand
-# ====================================================
-
-###########################
-# sub sort_thread