lib/scripts/yxml.pl
changeset 35060 6088dfd5f9c8
parent 35059 acbc346e5310
parent 35054 a5db9779b026
child 35061 be1e25a62ec8
child 35108 eeec2a320a77
     1.1 --- a/lib/scripts/yxml.pl	Mon Feb 08 15:49:01 2010 -0800
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,35 +0,0 @@
     1.4 -#
     1.5 -# Author: Makarius
     1.6 -#
     1.7 -# yxml.pl - simple XML to YXML converter
     1.8 -#
     1.9 -
    1.10 -use strict;
    1.11 -use XML::Parser;
    1.12 -
    1.13 -binmode(STDOUT, ":utf8");
    1.14 -
    1.15 -sub handle_start {
    1.16 -  print chr(5), chr(6), $_[1];
    1.17 -  for (my $i = 2; $i <= $#_; $i++) {
    1.18 -    print ($i % 2 == 0 ? chr(6) : "=");
    1.19 -    print $_[$i];
    1.20 -  }
    1.21 -  print chr(5);
    1.22 -}
    1.23 -
    1.24 -sub handle_end {
    1.25 -  print chr(5), chr(6), chr(5);
    1.26 -}
    1.27 -
    1.28 -sub handle_char {
    1.29 -  print $_[1];
    1.30 -}
    1.31 -
    1.32 -my $parser = new XML::Parser(Handlers =>
    1.33 -  {Start => \&handle_start,
    1.34 -    End => \&handle_end,
    1.35 -    Char => \&handle_char});
    1.36 -
    1.37 -$parser->parse(*STDIN) or die $!;
    1.38 -