blib/lib/XML/Compile/C14N/Util.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 30 SCAR 6.9
CC
1
Cov
0%
is_canon_constant
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # Copyrights 2011-2014 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.01.
5 use warnings;
6 use strict;
7  
8 package XML::Compile::C14N::Util;
9 our $VERSION = '0.94';
10  
11 use base 'Exporter';
12  
13 my @c14n = qw/
14 C14N_v10_NO_COMM
15 C14N_v10_COMMENTS
16 C14N_v11_NO_COMM
17 C14N_v11_COMMENTS
18 C14N_EXC_NO_COMM
19 C14N_EXC_COMMENTS
20 C14N_EXC_NS
21 /;
22  
23 my @paths = qw/
24 C14N10
25 C14N11
26 C14NEXC
27 is_canon_constant
28 /;
29  
30 our @EXPORT = qw/C14N_EXC_NS/;
31 our @EXPORT_OK = (@c14n, @paths);
32  
33 our %EXPORT_TAGS =
34 ( c14n => \@c14n
35 , paths => \@paths
36 );
37  
38  
39 # Path components
40 use constant
41 { C14N10 => 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'
42 , C14N11 => 'http://www.w3.org/2006/12/xml-c14n11'
43 , C14NEXC => 'http://www.w3.org/2001/10/xml-exc-c14n'
44 };
45  
46  
47 use constant
48 { C14N_v10_NO_COMM => C14N10
49 , C14N_v10_COMMENTS => C14N10. '#WithComments'
50 , C14N_v11_NO_COMM => C14N11
51 , C14N_v11_COMMENTS => C14N11. '#WithComments'
52 , C14N_EXC_NO_COMM => C14NEXC.'#'
53 , C14N_EXC_COMMENTS => C14NEXC.'#WithComments'
54 , C14N_EXC_NS => C14NEXC.'#'
55 };
56  
57  
58 my $is_canon = qr/^(?:\Q${\C14N10}\E|\Q${\C14N11}\E|\Q${\C14NEXC}\E)\b/;
59 sub is_canon_constant($) { $_[0] =~ $is_canon }
60  
61 1;