package MTerminal::XML;
use strict;

use MCoreTools;

sub new {return $_[0]}
sub init {$_[1]->send_str('<connection>');}

sub output {
  my ($self, $con, $sx) = @_;
  
  $con->send_str(sx2xml($sx) . "\cJ");
}

sub input {
  my ($self, $con, $input) = @_;
  
  $input =~ tr/\n\x20-\x7F//cd; # throw out any nonprintables left
  return $input;
}

sub needs_prompt {}

sub input_post {}
sub dispose {$_[1]->send_str('</connection>')}

1;
