From 64d8200bcd9d410ca3741acaea6b78de6d16eb93 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 20 Oct 2006 14:51:01 +0000 Subject: [PATCH] xml_encode() moved to IRSpy.pm Exporting structure removed. --- lib/ZOOM/IRSpy/Record.pm | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/lib/ZOOM/IRSpy/Record.pm b/lib/ZOOM/IRSpy/Record.pm index c213f54..532603a 100644 --- a/lib/ZOOM/IRSpy/Record.pm +++ b/lib/ZOOM/IRSpy/Record.pm @@ -1,4 +1,4 @@ -# $Id: Record.pm,v 1.15 2006-10-13 13:41:57 sondberg Exp $ +# $Id: Record.pm,v 1.16 2006-10-20 14:51:01 mike Exp $ package ZOOM::IRSpy::Record; @@ -6,9 +6,6 @@ use 5.008; use strict; use warnings; -use Exporter 'import'; -our @EXPORT_OK = qw(xml_encode); - use XML::LibXML; use XML::LibXML::XPathContext; @@ -51,9 +48,9 @@ sub _empty_zeerex_record { ### Doesn't recognise SRU/SRW URLs my($host, $port, $db) = ZOOM::IRSpy::_parse_target_string($target); - my $xhost = xml_encode($host); - my $xport = xml_encode($port); - my $xdb = xml_encode($db); + my $xhost = ZOOM::IRSpy::xml_encode($host); + my $xport = ZOOM::IRSpy::xml_encode($port); + my $xdb = ZOOM::IRSpy::xml_encode($db); return <<__EOT__; @@ -66,22 +63,6 @@ __EOT__ } -# I can't -- just can't, can't, can't -- believe that this function -# isn't provided by one of the core XML modules. But the evidence all -# says that it's not: among other things, XML::Generator and -# Template::Plugin both roll their own. So I will do likewise. D'oh! -# -sub xml_encode { - my ($text) = @_; - $text =~ s/&/&/g; - $text =~ s//>/g; - $text =~ s/['']/'/g; - $text =~ s/[""]/"/g; - return $text; -} - - sub append_entry { my $this = shift(); my($xpath, $frag) = @_; -- 1.7.10.4