gpsfold: Remove $Id$ at EOF.
[gpstools.git] / branches / gpst.near / GPSTxml.pm
blob257d7f84be53479e2af5134c75b45a200c621947
1 package GPSTxml;
3 #=======================================================================
4 # $Id$
6 # Character set: UTF-8
7 # ©opyleft 2002– Øyvind A. Holm <sunny@sunbase.org>
8 # License: GNU General Public License, see end of file for legal stuff.
9 #=======================================================================
11 use strict;
12 use warnings;
14 BEGIN {
15 use Exporter ();
16 our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
18 my $rcs_id = '$Id$';
19 push(@main::version_array, $rcs_id);
20 $VERSION = ($rcs_id =~ / (\d+) /, $1);
22 @ISA = qw(Exporter);
23 @EXPORT = qw(&txt_to_xml &xml_to_txt);
24 %EXPORT_TAGS = ();
26 our @EXPORT_OK;
28 sub txt_to_xml {
29 # Convert plain text to XML {{{
30 my $Txt = shift;
31 $Txt =~ s/&/&amp;/gs;
32 $Txt =~ s/</&lt;/gs;
33 $Txt =~ s/>/&gt;/gs;
34 return($Txt);
35 # }}}
38 sub xml_to_txt {
39 # Convert XML data to plain text {{{
40 my $Txt = shift;
41 $Txt =~ s/&lt;/</gs;
42 $Txt =~ s/&gt;/>/gs;
43 $Txt =~ s/&amp;/&/gs;
44 return($Txt);
45 # }}}