line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id$ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2005-2007 Daisuke Maki |
4
|
|
|
|
|
|
|
# All rights reserved. |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package XML::RSS::LibXML::Namespaces; |
7
|
2
|
|
|
2
|
|
5951
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
70
|
|
8
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
56
|
|
9
|
2
|
|
|
2
|
|
22
|
use base qw(Exporter); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
150
|
|
10
|
2
|
|
|
2
|
|
10
|
use vars qw(@EXPORT_OK); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
414
|
|
11
|
|
|
|
|
|
|
my %KnownNamespaces; |
12
|
|
|
|
|
|
|
my %RevKnownNamespaces; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
BEGIN |
15
|
|
|
|
|
|
|
{ |
16
|
2
|
|
|
2
|
|
25
|
%KnownNamespaces = ( |
17
|
|
|
|
|
|
|
rdf => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", |
18
|
|
|
|
|
|
|
dc => "http://purl.org/dc/elements/1.1/", |
19
|
|
|
|
|
|
|
syn => "http://purl.org/rss/1.0/modules/syndication/", |
20
|
|
|
|
|
|
|
admin => "http://webns.net/mvcb/", |
21
|
|
|
|
|
|
|
content => "http://purl.org/rss/1.0/modules/content/", |
22
|
|
|
|
|
|
|
cc => "http://web.resource.org/cc/", |
23
|
|
|
|
|
|
|
taxo => "http://purl.org/rss/1.0/modules/taxonomy/", |
24
|
|
|
|
|
|
|
rss20 => "http://backend.userland.com/rss2", # really a dummy |
25
|
|
|
|
|
|
|
rss10 => "http://purl.org/rss/1.0/", |
26
|
|
|
|
|
|
|
rss09 => "http://my.netscape.com/rdf/simple/0.9/", |
27
|
|
|
|
|
|
|
); |
28
|
2
|
|
|
|
|
13
|
%RevKnownNamespaces = map { ($KnownNamespaces{$_} => $_) } keys %KnownNamespaces; |
|
20
|
|
|
|
|
52
|
|
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
5
|
my %constants; |
31
|
2
|
|
|
|
|
11
|
while (my ($prefix, $ns) = each %KnownNamespaces) { |
32
|
20
|
|
|
|
|
74
|
$constants{'NS_' . uc($prefix)} = $ns; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
11
|
require constant; |
36
|
2
|
|
|
|
|
299
|
constant->import(\%constants); |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
148
|
@EXPORT_OK = keys %constants; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
|
sub lookup_prefix { $RevKnownNamespaces{$_[0]} } |
42
|
0
|
|
|
0
|
1
|
|
sub lookup_uri { $KnownNamespaces{$_[0]} } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |