File Coverage

blib/lib/SGML/DTDParse/Util.pm
Criterion Covered Total %
statement 9 14 64.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 21 61.9


line stmt bran cond sub pod time code
1             #
2             # $Id: Util.pm,v 2.2 2005/07/16 03:21:35 ehood Exp $
3              
4             package SGML::DTDParse::Util;
5              
6 1     1   7 use strict;
  1         4  
  1         51  
7 1     1   6 use vars qw($VERSION $CVS @ISA @EXPORT_OK %EXPORT_TAGS);
  1         2  
  1         451  
8 1     1   7 use Exporter;
  1         2  
  1         213  
9              
10             $VERSION = do { my @r=(q$Revision: 2.2 $=~/\d+/g); sprintf "%d."."%03d"x$#r,@r };
11             $CVS = '$Id: Util.pm,v 2.2 2005/07/16 03:21:35 ehood Exp $ ';
12              
13             @ISA = qw(Exporter);
14             @EXPORT_OK = qw(
15             entify
16             );
17             %EXPORT_TAGS = (
18             ALL => qw(
19             entify
20             ),
21             );
22              
23             #############################################################################
24              
25             sub entify {
26 0     0 1   my $str = shift;
27 0 0         return undef unless defined($str);
28 0           $str =~ s/([&<>"])/sprintf("&#x%X;",ord($1))/ge;
  0            
29 0           $str;
30             }
31              
32             #############################################################################
33             1;
34              
35             __END__